How to Make All Objects in an Amazon S3 Bucket Public by Default?

There are several ways to make objects in an S3 bucket public. The first is to use the following bucket policy:

{
  "Version": "2012-10-17",
  "Statement": {
    "Action": "s3:GetObject",
    "Effect": "Allow",
    "Resource": "arn:aws:s3:::my-bucket/*",
    "Principal": "*"
  }
}

This (& other) policies can be generated using AWS’s official policy generator at awspolicygen.s3.amazonaws.com/policygen.html:

You can also use the (legacy) Access Control Lists to allow public read:

If you’re using the S3 CLI to synchronize local directories with an S3 bucket & want all such files to be public, do this:

aws s3 sync ./local-directory s3://my-bucket --acl=public-read

Also see:

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.