# IAM policy example: limit EC2 actions to one Region, with a least privilege rewrite

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

Allows EC2 actions in us-east-1 only, by comparing the aws:RequestedRegion condition key. Calls aimed at any other Region fail. The wildcard ec2:* expands to 834 actions, so the rewrite names the five compute actions a build team needs. The names and the account ID 111122223333 are AWS documentation placeholders.

```json
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "OneRegion",
      "Effect": "Allow",
      "Action": "ec2:*",
      "Resource": "*",
      "Condition": {
        "StringEquals": {
          "aws:RequestedRegion": "us-east-1"
        }
      }
    }
  ]
}
```

## What it allows

- Allows every EC2 action on every resource when the request targets us-east-1.

- Allows 834 actions (ec2:*) on every resource when aws:RequestedRegion StringEquals us-east-1.

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

The Region limit works, yet the action list includes 834 actions across networking, images and volumes.

## Least privilege rewrite

```json
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "InstancesInRegion",
      "Effect": "Allow",
      "Action": [
        "ec2:RunInstances",
        "ec2:StartInstances",
        "ec2:StopInstances",
        "ec2:DescribeInstances",
        "ec2:CreateTags"
      ],
      "Resource": "*",
      "Condition": {
        "StringEquals": {
          "aws:RequestedRegion": "us-east-1"
        }
      }
    }
  ]
}
```

The rewrite keeps the Region condition and lists five actions for launching and managing instances. Image, network and volume administration are removed.

- Allows 5 actions (ec2:RunInstances, ec2:StartInstances, ec2:StopInstances, ec2:DescribeInstances, ec2:CreateTags) on every resource when aws:RequestedRegion StringEquals us-east-1.

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

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

## Related pages

- [IAM policy example: launch EC2 instances in one subnet](/examples/ec2-run-instances-in-one-subnet/)
- [IAM policy example: snapshot tagged EBS volumes](/examples/ec2-create-snapshots-tagged-volumes/)
- [IAM policy example: invoke one Lambda function](/examples/lambda-invoke-one-function/)
- [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)
- 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-actions-in-one-region/

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