Skip to content

Instantly share code, notes, and snippets.

@leommoore
Last active November 9, 2020 18:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leommoore/aa985980b5335136078d0a818ae1e49b to your computer and use it in GitHub Desktop.
Save leommoore/aa985980b5335136078d0a818ae1e49b to your computer and use it in GitHub Desktop.
S3 Make a Bucket Public

S3 Make a Bucket Public

By default, files uploaded to Amazon S3 are private, requiring a separate action to make public. To make uploads default to public, add this policy to your S3 bucket.

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

If you aren’t sure how to add a policy, follow these steps:

  1. click on bucket
  2. expand the Permissions row
  3. click “Add Bucket Policy”
  4. copy/paste the snippet below into the text area.
  5. change MY_BUCKET_NAME to the bucket you want
  6. submit your changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment