How to rename the file in S3 bucket through Lambda Function

Viewed 3515

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

1 Answers

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:

Related