IAM policy example: read and write one S3 bucket, with a least privilege rewrite
Facts read 16 Nov 2026. Page reviewed 16 Nov 2026.
Allows listing one bucket, reading, writing and deleting objects in it, and reading its location. The AWS documentation has a read and write example for a single bucket, and this one starts from the wider s3:* form. The rewrite replaces it with three object actions and two bucket actions.
Open the workbench ยท All examples
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "BucketAdmin",
"Effect": "Allow",
"Action": "s3:*",
"Resource": [
"arn:aws:s3:::amzn-s3-demo-bucket",
"arn:aws:s3:::amzn-s3-demo-bucket/*"
]
}
]
}
What it allows
- Allows every S3 action on the bucket and all objects in it, including deleting the bucket and changing its policy.
What it allows
Allow 180 actions (s3:*) on arn:aws:s3:::amzn-s3-demo-bucket, arn:aws:s3:::amzn-s3-demo-bucket/*.
Action or pattern Actions Access levels s3:*180 List 18, Read 66, Write 57, Permissions management 27, Tagging 12
Checks
No flags from the six checks.
The s3:* action covers 180 actions, including bucket deletion and policy changes.
Least privilege rewrite
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "ListBucket",
"Effect": "Allow",
"Action": [
"s3:ListBucket",
"s3:GetBucketLocation"
],
"Resource": "arn:aws:s3:::amzn-s3-demo-bucket"
},
{
"Sid": "ObjectReadWrite",
"Effect": "Allow",
"Action": [
"s3:GetObject",
"s3:PutObject",
"s3:DeleteObject"
],
"Resource": "arn:aws:s3:::amzn-s3-demo-bucket/*"
}
]
}
The rewrite splits bucket actions from object actions and lists the three object actions the application uses. Bucket deletion and policy changes are no longer possible.
What it allows
Allow 2 actions (s3:ListBucket, s3:GetBucketLocation) on arn:aws:s3:::amzn-s3-demo-bucket.
Action or pattern Actions Access levels s3:ListBucket1 List 1 s3:GetBucketLocation1 Read 1 Allow 3 actions (s3:GetObject, s3:PutObject, s3:DeleteObject) on arn:aws:s3:::amzn-s3-demo-bucket/*.
Action or pattern Actions Access levels s3:GetObject1 Read 1 s3:PutObject1 Write 1 s3:DeleteObject1 Write 1
Checks
No flags from the six checks.
Related pages
Sources
- IAM User Guide: S3 read and write access to one bucket, read 16 Nov 2026
- Amazon S3 User Guide: identity-based policy examples, read 16 Nov 2026
- AWS Service Authorization Reference, programmatic access (fetched 16 Nov 2026), read 16 Nov 2026
Last reviewed 16 Nov 2026.