
Explanation:
The Condition block uses the global condition key aws:RequestedRegion with a StringEquals operator. This restricts the ec2:RunInstances action so that it only succeeds if the request is made in the ap-south-1 (Mumbai) or ap-southeast-1 (Singapore) regions.
Ultimate access to all questions.
Question 3
A developer has the following policy attached. Which AWS regions can they launch EC2 instances in?
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "ec2:RunInstances",
"Resource": "*",
"Condition": {
"StringEquals": {
"aws:RequestedRegion": ["ap-south-1", "ap-southeast-1"]
}
}
}
]
}
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "ec2:RunInstances",
"Resource": "*",
"Condition": {
"StringEquals": {
"aws:RequestedRegion": ["ap-south-1", "ap-southeast-1"]
}
}
}
]
}
A
All AWS regions
B
Only ap-south-1
C
Only ap-south-1 and ap-southeast-1
D
No regions — RunInstances is not a valid action
No comments yet.