Atul
Atul

Reputation: 55

How to rename the file in S3 bucket through Lambda Function

Is there any way to rename the file in S3 bucket through Lambda function? is there any link or code available to do this?

Upvotes: 2

Views: 5751

Answers (1)

John Rotenstein
John Rotenstein

Reputation: 270154

It is not possible to rename objects in Amazon S3 because the unique object identifier is the Key, which is also the name of the object.

Instead, you will need to copy the object to a new object, then delete the old object.

For example, if you were using Python, you would use:

Upvotes: 1

Related Questions