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

Facts read 16 Nov 2026. Page reviewed 16 Nov 2026.

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.

```json
{
  "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.

- Allows 3 actions (ec2:CreateSnapshot, ec2:CreateTags, ec2:DeleteSnapshot) on every resource.

Checks:
- medium: Allows 2 write or permissions-management actions on every resource ("Resource": "*"). (https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html)

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

## Least privilege rewrite

```json
{
  "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.

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

Checks:
- No flags.

- [Paste it into the workbench](/)
- [Every EC2 action and its access level](/actions/ec2/)

## Related pages

- [IAM policy example: invoke one Lambda function](/examples/lambda-invoke-one-function/)
- [IAM policy example: deploy code to one Lambda function](/examples/lambda-deploy-one-function/)
- [IAM policy example: let a Lambda function write logs](/examples/lambda-execution-role-write-logs/)
- [All of them](/examples/)

## Sources

- IAM User Guide: EC2 access in a specific Region: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_examples_ec2_region.html (read 16 Nov 2026)
- IAM User Guide: attribute-based access control tutorial: https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_attribute-based-access-control.html (read 16 Nov 2026)
- AWS Service Authorization Reference, programmatic access (fetched 16 Nov 2026): https://docs.aws.amazon.com/service-authorization/latest/reference/service-reference.html (read 16 Nov 2026)

Last reviewed 16 Nov 2026. Canonical: https://iampolicygenerator.com/examples/ec2-create-snapshots-tagged-volumes/

This site is not affiliated with Amazon Web Services. AWS service and product names are used only to describe AWS services.
