I needed to get all files in a bucket readable by the public easily. Here is the S3 Bucket Policy I applied:
1
2
3
4
5
6
7
8
9
10
11
12
{
"Version":"2012-10-17",
"Statement":[
{
"Sid":"PublicReadGetObject",
"Effect":"Allow",
"Principal":"*",
"Action":"s3:GetObject",
"Resource":"arn:aws:s3:::BUCKET_NAME_HERE/*"
}
]
}
To do this via the aws cli command, create the file s3_read_policy.json containing the policy above, with your bucket name in place of BUCKET_NAME_HERE:
The aws s3 sync command is slow and painful! I needed a more efficient way to sync to large buckets (prod to dev). Finally settled on RClone: https://rclone.org/docs/
1. You need Ruby, rubygems and the right_aws gem. yum install ruby rubygems gem update –system gem install right_aws 2. Replace any values inside curly braces {} below with real values and remove the curly braces. YMMV