Skip to content
IAM Policy Generator

IAM policy example: read and write one S3 bucket, with a least privilege rewrite

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

  1. Allow 180 actions (s3:*) on arn:aws:s3:::amzn-s3-demo-bucket, arn:aws:s3:::amzn-s3-demo-bucket/*.

    Action or patternActionsAccess levels
    s3:*180List 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

  1. Allow 2 actions (s3:ListBucket, s3:GetBucketLocation) on arn:aws:s3:::amzn-s3-demo-bucket.

    Action or patternActionsAccess levels
    s3:ListBucket1List 1
    s3:GetBucketLocation1Read 1
  2. Allow 3 actions (s3:GetObject, s3:PutObject, s3:DeleteObject) on arn:aws:s3:::amzn-s3-demo-bucket/*.

    Action or patternActionsAccess levels
    s3:GetObject1Read 1
    s3:PutObject1Write 1
    s3:DeleteObject1Write 1

Checks

No flags from the six checks.

Sources

  1. IAM User Guide: S3 read and write access to one bucket, read 16 Nov 2026
  2. Amazon S3 User Guide: identity-based policy examples, read 16 Nov 2026
  3. AWS Service Authorization Reference, programmatic access (fetched 16 Nov 2026), read 16 Nov 2026

Last reviewed 16 Nov 2026.