Sai
Sai

Reputation: 2109

How can I recover from Access Denied Error on AWS S3?

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

Upvotes: 0

Views: 592

Answers (1)

Arun
Arun

Reputation: 760

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.

Upvotes: 0

Related Questions