How To Set an Entire AWS S3 Bucket to Public Read Using a Policy
![Published Date](https://www.ericmichaelstone.com/wp-content/themes/me3/images/calendar.png)
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:
1 |
aws s3api put-bucket-policy --bucket BUCKET_NAME_HERE --policy file://s3_read_policy.json |
Leave Your Comment![Leave a comment](https://www.ericmichaelstone.com/wp-content/themes/me3/images/comments.png)
All fields marked with "*" are required.