AWS::S3 rename a folder

The documentation for AWS::S3 explains this pretty well. When storing files on s3, there are no such things as folders. There is a bucket (your APP_CONFIG[:s3_bucket] presumably), and there are objects. That is it. There are no folders. One of your objects might be named /files/public/system/whatever/derp.jpg - but there are no folders there, only an object with a name that looks like a path, and then the value of the object (the actual file residing at that location).

So to answer your question, you cannot rename folders because there is no such thing on s3. You have to rename individual objects.


you can copy objects from one s3://[path_1] to another s3://[path_2] via aws console https://docs.aws.amazon.com/cli/latest/reference/s3/mv.html

example move objects between diff buckets:

aws s3 mv s3://[s3-name1]/folder1 s3://[s3-name2]/[folder2] --recursive 

or within the same s3

aws s3 cp s3://[s3-name1]/folder1 s3://[s3-name1]/[folder2] --recursive 

Tags:

Ruby

Amazon S3