Attached to IAM users/roles. Controls what API calls they can make. Example: Allow John to upload but not delete.
| Type | Scope | Use |
|---|---|---|
| Bucket Policy | Whole bucket | Most common. Cross-account access. |
| Object ACL | Per object | Fine-grained. Rarely used. Can be disabled. |
| Bucket ACL | Whole bucket | Less common. Can be disabled. |
Simple rule:
(IAM says YES OR Bucket Policy says YES) AND (No explicit DENY)
JSON policy attached to a bucket. Four key fields:
Allow or Denys3:GetObject, s3:PutObject)Example — Make bucket public:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PublicRead",
"Effect": "Allow",
"Principal": "*",
"Action": ["s3:GetObject"],
"Resource": ["arn:aws:s3:::your-bucket-name/*"]
}
]
}