Syncing a bucket doesn't seem to copy the access rights for files. This script changes the
acl for all objects in the bucket to public-read
require 'aws-sdk'
region_code = 'REGION_CODE_HERE'
aws_access_key = 'ACCESS_KEY_ID_HERE'
aws_secret_access_key = 'SECRET_ACCESS_KEY_HERE'
bucket_name = 'BUCKET_NAME_HERE'
Aws.config.update({
region: region_code,
credentials: Aws::Credentials.new(
aws_access_key,
aws_secret_access_key
)
})
s3 = Aws::S3::Resource.new
s3.bucket(bucket_name).objects.each do |object|
puts object.key
object.acl.put({ acl: 'public-read' })
end