Skip to content
IAM Policy Generator

IAM policy example: snapshot tagged EBS volumes, with a least privilege rewrite

Allows a backup role to create snapshots of EBS volumes tagged Backup=true and to tag the new snapshots at creation. The original also allows deleting any snapshot, on all resources, so a compromised backup role could destroy the backups. The names and the account ID 111122223333 are AWS documentation placeholders.

Open the workbench ยท All examples

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "Snapshots",
      "Effect": "Allow",
      "Action": [
        "ec2:CreateSnapshot",
        "ec2:CreateTags",
        "ec2:DeleteSnapshot"
      ],
      "Resource": "*"
    }
  ]
}

What it allows

  • Allows creating and deleting snapshots and tags on all resources in every Region.

What it allows

  1. Allow 3 actions (ec2:CreateSnapshot, ec2:CreateTags, ec2:DeleteSnapshot) on every resource.

    Action or patternActionsAccess levels
    ec2:CreateSnapshot1Write 1
    ec2:CreateTags1Tagging 1
    ec2:DeleteSnapshot1Write 1

Checks

Delete on all snapshots lets a compromised backup role destroy the backups it made and those of other teams.

Least privilege rewrite

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "SnapshotTaggedVolumes",
      "Effect": "Allow",
      "Action": "ec2:CreateSnapshot",
      "Resource": "arn:aws:ec2:us-east-1:111122223333:volume/*",
      "Condition": {
        "StringEquals": {
          "ec2:ResourceTag/Backup": "true"
        }
      }
    },
    {
      "Sid": "SnapshotCreate",
      "Effect": "Allow",
      "Action": "ec2:CreateSnapshot",
      "Resource": "arn:aws:ec2:us-east-1::snapshot/*"
    },
    {
      "Sid": "TagOnCreate",
      "Effect": "Allow",
      "Action": "ec2:CreateTags",
      "Resource": "arn:aws:ec2:us-east-1::snapshot/*",
      "Condition": {
        "StringEquals": {
          "ec2:CreateAction": "CreateSnapshot"
        }
      }
    }
  ]
}

The rewrite limits snapshots to tagged volumes in one Region, allows tagging only at creation, and removes DeleteSnapshot.

What it allows

  1. Allow 1 action (ec2:CreateSnapshot) on arn:aws:ec2:us-east-1:111122223333:volume/* when ec2:ResourceTag/Backup StringEquals true.

    Action or patternActionsAccess levels
    ec2:CreateSnapshot1Write 1
  2. Allow 1 action (ec2:CreateSnapshot) on arn:aws:ec2:us-east-1::snapshot/*.

    Action or patternActionsAccess levels
    ec2:CreateSnapshot1Write 1
  3. Allow 1 action (ec2:CreateTags) on arn:aws:ec2:us-east-1::snapshot/* when ec2:CreateAction StringEquals CreateSnapshot.

    Action or patternActionsAccess levels
    ec2:CreateTags1Tagging 1

Checks

No flags from the six checks.

Sources

  1. IAM User Guide: EC2 access in a specific Region, read 16 Nov 2026
  2. IAM User Guide: attribute-based access control tutorial, read 16 Nov 2026
  3. AWS Service Authorization Reference, programmatic access (fetched 16 Nov 2026), read 16 Nov 2026

Last reviewed 16 Nov 2026.