Reputation: 51
I have a current S3 bucket with existing files.
The bucket was originally a public bucket, I changed its permissions to be private, but I already have objects that were uploaded and have public read
CannedACL permissions.
How do I change the permissions on all of the uploaded objects to private CannedACL?
Upvotes: 2
Views: 1854
Reputation: 51
aws s3 cp s3://my-bucket/ s3://my-bucket/ --metadata x-amz-meta-updated=1 --recursive --acl private
Upvotes: 3
Reputation: 269490
You can use the AWS Command-Line Interface (CLI) to change the permissions in-bulk.
You will use the aws s3 cp
command. While this is a copy command, it can also be used to copy files in place, which simply changes their permissions.
For example:
aws s3 cp s3://my-bucket/ s3://my-bucket/ --recursive --acl bucket-owner-full-control
(bucket-owner-full-control
: Both the object owner and the bucket owner get FULL_CONTROL over the object.)
See also: Amazon S3 File Permissions, Access Denied when copied from another account
Upvotes: 2