Amazon EC2: Allows full EC2 access within a specific Region, programmatically and in the console - AWS Identity and Access Management

Amazon EC2: Allows full EC2 access within a specific Region, programmatically and in the console

This example shows how you might create an IAM policy that allows full EC2 access within a specific Region. This policy also grants the necessary permissions to complete this action on the console. To use this policy, replace the italicized placeholder text in the example policy with your own information. Then, follow the directions in create a policy or edit a policy. For a list of Region codes, see Available Regions in the Amazon EC2 User Guide.

Alternatively, you can use the global condition key aws:RequestedRegion, which is supported by all Amazon EC2 API actions. For more information, see Example: Restricting access to a specific Region in the Amazon EC2 User Guide.

{ "Version": "2012-10-17", "Statement": [ { "Action": "ec2:*", "Resource": "*", "Effect": "Allow", "Condition": { "StringEquals": { "ec2:Region": "us-east-2" } } } ] }