IAM policy example: read EC2 inventory, with a least privilege rewrite
Facts read 16 Nov 2026. Page reviewed 16 Nov 2026.
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
Allow 195 actions (ec2:Describe*) on every resource.
Action or pattern Actions Access levels ec2:Describe*195 List 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
Allow 7 actions (ec2:DescribeInstances, ec2:DescribeVolumes, ec2:DescribeSnapshots, ec2:DescribeSecurityGroups, ec2:DescribeSubnets, ec2:DescribeVpcs, ec2:DescribeTags) on every resource.
Action or pattern Actions Access levels ec2:DescribeInstances1 List 1 ec2:DescribeVolumes1 List 1 ec2:DescribeSnapshots1 List 1 ec2:DescribeSecurityGroups1 List 1 ec2:DescribeSubnets1 List 1 ec2:DescribeVpcs1 List 1 ec2:DescribeTags1 List 1
Checks
No flags from the six checks.
Related pages
Sources
- IAM User Guide: EC2 access in a specific Region, read 16 Nov 2026
- IAM User Guide: EC2 instances in a specific subnet, read 16 Nov 2026
- AWS Service Authorization Reference, programmatic access (fetched 16 Nov 2026), read 16 Nov 2026
Last reviewed 16 Nov 2026.