0
votes

I am trying to host a public facing static website on AWS S3.

  1. I logged into the AWS console from my root account
  2. Created a new bucket and uploaded few static HTML files
  3. Under {Bucket-name}->Permissions->Bucket Policy, I have provided the below policy

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

I keep getting the Access denied error.

enter image description here

1
A simple Google search can also return Amazon docs. I am trying to follow the below tutorial and enabling website hosting is the step you perform after editing bucket policy. aws.amazon.com/getting-started/projects/… - Sai
try to allow resources arn:aws:s3:::[my-bucket-name]/*, though I'd advice using a GUI option on the bucket to host a website, the gui should set the correct policy for you - gusto2

1 Answers

0
votes

Try "Principal" : "*" in bucket policy and also you need to add s3:ListBucket permission to be able to list the bucket. ListBucket permission needs to be added as separate statement in the policy.