← Back to all fixes
AWS

S3 returns 403 Access Denied

The Issue

`aws s3 cp file.txt s3://mybucket/` returns: `upload failed: An error occurred (AccessDenied)`

Root Cause

IAM policy does not grant the required s3:PutObject permission, bucket policy explicitly denies, or "Block Public Access" settings are blocking the operation.

How to Fix
  1. Check IAM policy attached to your user/role includes `s3:GetObject` / `s3:PutObject` for the bucket ARN
  2. Check bucket policy for explicit Deny statements — they override IAM allows
  3. If accessing publicly: check "Block Public Access" settings in S3 console
  4. Test with AWS Policy Simulator: IAM console > Policy Simulator — test your actions
  5. Check the bucket region matches your CLI config: `aws s3 ls s3://mybucket --region eu-west-1`