Written by James McDonald

June 11, 2017

Been working towards my Amazon Certified Solutions Architect — Associate qualification.

Created a static website from an S3 bucket and everytime I synced my local files up to it I would get access denied due to the sync removing perms.

But that is where bucket policies come in you just need to add one that allows everyone to read it.

You can copy and edit one in the docs: https://docs.aws.amazon.com/AmazonS3/latest/dev/example-bucket-policies.html#example-bucket-policies-use-case-2

or use the policy generator http://awspolicygen.s3.amazonaws.com/policygen.html

Either way you end up with a policy that will enable public read for all objects in your bucket and stop an aws s3 sync . s3://bucketname  wiping out your ACL

{
  "Version":"2012-10-17",
  "Statement":[
    {
      "Sid":"AddPerm",
      "Effect":"Allow",
      "Principal": "*",
      "Action":["s3:GetObject"],
      "Resource":["arn:aws:s3:::examplebucket/*"]
    }
  ]
}

 

 

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

The reCAPTCHA verification period has expired. Please reload the page.

You May Also Like…

Network speed test host to host

On Ubuntu / Debian apt-get install iperf3 On Windows download it from https://iperf.fr/iperf-download.php#windows Make...

Clear HSTS Settings in CHrome

Open chrome://net-internals/#hsts enter the domain in the query field and click Query to confirm it has HSTS settings...