AWS S3 Bucket Rename Cost

I want to rename the folder to the S3 bucket, I understand that renaming will trigger a PUT request, which costs 1 cent per 1000 requests.

However, a PUT request is defined as a COPY and also includes a GET

My question is, when renaming a folder to an S3 bucket, does this involve copying all the subfolders and files to the new folder with the name I want (which costs more than 1 PUT request), or just just 1 PUT to change the name without touching all items in the folder.

+5
source share
1 answer

If you missed it ... there are no folders in S3.

The /pics/funny/cat.jpg object /pics/funny/cat.jpg not a file named cat.jpg inside a folder named funny inside another folder named pics .

In fact, this is a file with an 18-character name: pics/funny/cat.jpg . The hierarchy shown on the console is largely human-friendly, and the ability to create new folders on the console is also an illusion.

So, yes, renaming a “folder” actually means creating a new copy of each object in the “folder” with changing the names of the objects so that they look like they are on the way.

This can be done with a PUT/COPY request ($ 0.005 per 1000 depending on the region), followed by a DELETE request for the old object (free). There is no corresponding GET request, because PUT/COPY is an atomic operation inside S3, so data loading and reloading is not performed.

+8
source

Source: https://habr.com/ru/post/1233197/