Skip to content
IAM Policy Generator

IAM policy example: read EC2 inventory, with a least privilege rewrite

Allows a principal to describe EC2 instances, volumes, security groups and other resources in the account, which is the usual read-only inventory need. The Describe wildcard expands to 195 actions. The rewrite lists seven describe calls that an inventory script needs.

Open the workbench ยท All examples

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "DescribeAll",
      "Effect": "Allow",
      "Action": "ec2:Describe*",
      "Resource": "*"
    }
  ]
}

What it allows

  • Allows every EC2 action that starts with Describe on all resources.
  • Most Describe actions do not support resource-level restrictions, so the resource is the wildcard.

What it allows

  1. Allow 195 actions (ec2:Describe*) on every resource.

    Action or patternActionsAccess levels
    ec2:Describe*195List 195

Checks

No flags from the six checks.

The wildcard returns metadata through 195 actions, including network layout, key pair names and instance attributes.

Least privilege rewrite

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "DescribeInventory",
      "Effect": "Allow",
      "Action": [
        "ec2:DescribeInstances",
        "ec2:DescribeVolumes",
        "ec2:DescribeSnapshots",
        "ec2:DescribeSecurityGroups",
        "ec2:DescribeSubnets",
        "ec2:DescribeVpcs",
        "ec2:DescribeTags"
      ],
      "Resource": "*"
    }
  ]
}

The rewrite lists seven describe calls. Attribute calls such as DescribeInstanceAttribute and key pair lookups are removed. The resource stays a wildcard because these actions lack resource-level support.

What it allows

  1. Allow 7 actions (ec2:DescribeInstances, ec2:DescribeVolumes, ec2:DescribeSnapshots, ec2:DescribeSecurityGroups, ec2:DescribeSubnets, ec2:DescribeVpcs, ec2:DescribeTags) on every resource.

    Action or patternActionsAccess levels
    ec2:DescribeInstances1List 1
    ec2:DescribeVolumes1List 1
    ec2:DescribeSnapshots1List 1
    ec2:DescribeSecurityGroups1List 1
    ec2:DescribeSubnets1List 1
    ec2:DescribeVpcs1List 1
    ec2:DescribeTags1List 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: EC2 instances in a specific subnet, read 16 Nov 2026
  3. AWS Service Authorization Reference, programmatic access (fetched 16 Nov 2026), read 16 Nov 2026

Last reviewed 16 Nov 2026.