Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Make a bucket public in Amazon S3 [closed]

How can I set a bucket in Amazon S3 so all the files are publicly read-only by default?

like image 341
Victor Avatar asked Mar 30 '10 16:03

Victor


People also ask

Why S3 bucket should not be public?

Users can control the accessibility and privacy of their S3 buckets in bucket policy. It is recommended that AWS S3 buckets should not be publicly accessible to other users in AWS. Publicly accessible S3 bucket means that other AWS users can access your data stored in the bucket which can lead to misuse of the data.

Can a private S3 bucket have public objects?

Steps to allow public access to private AWS S3 bucket files: Click on the private S3 bucket with the object that you want to make public. Click on the Permissions tab. Click Edit on the Block public access section. Click on the Block all public access to uncheck and disable the options.

Are all S3 buckets public?

Object ACLs S3 objects do inherit parent bucket's permissions, but they can also have their own ACL that can bypass such permissions. You can make single objects public while the bucket ACL states it's private, although to access that object one must know the full path to it.


Video Answer


1 Answers

You can set a bucket policy as detailed in this blog post:

http://ariejan.net/2010/12/24/public-readable-amazon-s3-bucket-policy/


As per @robbyt's suggestion, create a bucket policy with the following JSON:

{   "Version": "2008-10-17",   "Statement": [{     "Sid": "AllowPublicRead",     "Effect": "Allow",     "Principal": { "AWS": "*" },     "Action": ["s3:GetObject"],     "Resource": ["arn:aws:s3:::bucket/*" ]   }] } 

Important: replace bucket in the Resource line with the name of your bucket.

like image 136
Intrications Avatar answered Oct 03 '22 05:10

Intrications