An S3 static website endpoint returns `403 Forbidden` with `Code: AccessDenied`.
IntermediateTroubleshootingS3, EBS and EFS
Answer
Likely causes → Block Public Access is on at the account or bucket level, or no bucket policy grants s3:GetObject to *. Also check that the index document exists exactly as named (keys are case-sensitive) and that objects are not KMS-encrypted (website endpoints cannot serve SSE-KMS objects).
Diagnose →
aws s3control get-public-access-block --account-id 111111111111
aws s3api get-public-access-block --bucket my-site
aws s3api get-bucket-policy --bucket my-site
aws s3api get-bucket-website --bucket my-site
aws s3 ls s3://my-site/index.html
Fix →
- In production, keep the bucket private and put CloudFront with OAC in front of it
- If a public website endpoint is truly intended, turn off BPA for that bucket only and add a read-only public policy for
arn:aws:s3:::my-site/*
Prevent → Keep account-level BPA on, and serve all public content through CloudFront.
More on S3, EBS and EFS
`BucketAlreadyExists: The requested bucket name is not available. The bucket namespace is shared by all users of the system.`Beginner`PermanentRedirect: The bucket you are attempting to access must be addressed using the specified endpoint.`BeginnerA partner account uploads objects into your bucket, but your own admins get `403 Forbidden` reading them.Intermediate`aws s3 cp` gets `An error occurred (AccessDenied) when calling the GetObject operation` but the IAM policy allows `s3:GetObject` and the bucket policy is fine.IntermediateHigh-throughput writes get `503 SlowDown: Please reduce your request rate.`Intermediate`BucketNotEmpty: The bucket you tried to delete is not empty. You must delete all versions in the bucket.` even after `aws s3 rm --recursive`.Beginner