Make a bucket public in Amazon S3

Victor picture Victor · Mar 30, 2010 · Viewed 149.6k times · Source

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

Answer

Intrications picture Intrications · Jan 17, 2011

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.