Created
March 8, 2017 14:10
-
-
Save tombeynon/88e1139f28245c104f47a97e94113850 to your computer and use it in GitHub Desktop.
Update ACL for all files in a bucket
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'aws-sdk' | |
Aws.config.update({ | |
region: 'REGION_CODE_HERE', | |
credentials: Aws::Credentials.new( | |
'ACCESS_KEY_ID_HERE', | |
'SECRET_ACCESS_KEY_HERE' | |
) | |
}) | |
bucket_name = 'BUCKET_NAME_HERE' | |
s3 = Aws::S3::Resource.new | |
s3.bucket(bucket_name).objects.each do |object| | |
puts object.key | |
object.acl.put({ acl: 'public-read' }) | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment