Archive
This post is archived and may contain outdated information. It has been set to 'noindex' and should stop showing up in search results.
This post is archived and may contain outdated information. It has been set to 'noindex' and should stop showing up in search results.
How to Make All Objects in Amazon S3 Bucket Public by Default
Aug 31, 2016Web DevelopmentComments (6)
If you want to make all items in your Amazon S3 bucket viewable by anyone that has the URL, you need to add a Bucket Policy that gives "Allow" permission to all users for all resources in your bucket.
Open the Properties for the bucket you want to make public.
Step 1
Click "Permissions":
Step 2
Click "Edit bucket policy":
Step 3
Here you enter the bucket policy by copying and pasting it in (or writing it directly in the text box). Amazon has an "AWS Policy Generator" that you can use to generate a policy, but it can be pretty confusing to use at first. Here is a sample policy to make anything in the bucket viewable publicly, without needing to individually mark items as public. Be sure to change test.h3xed.com to the actual name of your bucket.
Note: Users must still have the exact URL to resources. They cannot view the "index" of your bucket or list of contents.
Don't forget to hit "Save"!
Bucket Properties
Open the Properties for the bucket you want to make public.
Step 1
Click "Permissions":
Step 2
Click "Edit bucket policy":
Step 3
Here you enter the bucket policy by copying and pasting it in (or writing it directly in the text box). Amazon has an "AWS Policy Generator" that you can use to generate a policy, but it can be pretty confusing to use at first. Here is a sample policy to make anything in the bucket viewable publicly, without needing to individually mark items as public. Be sure to change test.h3xed.com to the actual name of your bucket.
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PublicReadGetObject",
"Action": "s3:GetObject",
"Effect": "Allow",
"Resource": "arn:aws:s3:::test.h3xed.com/*",
"Principal": "*"
}
]
}
Note: Users must still have the exact URL to resources. They cannot view the "index" of your bucket or list of contents.
Don't forget to hit "Save"!