Bird
0
0

Identify the error in this IAM policy statement:

medium📝 Debug Q14 of 15
AWS - Identity and Access Management
Identify the error in this IAM policy statement:
{
  "Effect": "Allow",
  "Action": ["ec2:StartInstances", "ec2:StopInstances"],
  "Resource": "*",
  "Condition": {
    "StringEquals": {
      "ec2:Region": "us-west-2"
    }
  }
}
AThe Condition key is not valid for EC2 actions
BThe Condition key should be inside the Action key
CThe policy is valid and has no errors
DThe Resource value "*" is not allowed for these actions
Step-by-Step Solution
Solution:
  1. Step 1: Check Condition usage with EC2 actions

    EC2 supports conditions like StringEquals on ec2:Region to restrict actions by region.
  2. Step 2: Verify Resource and structure

    Resource "*" is valid for EC2 start/stop actions because they apply to instances across resources.
  3. Final Answer:

    The policy is valid and has no errors -> Option C
  4. Quick Check:

    Condition on ec2:Region with Resource "*" is valid [OK]
Quick Trick: Conditions can restrict actions by region or other keys [OK]
Common Mistakes:
  • Thinking Condition is invalid for EC2
  • Assuming Resource "*" is always wrong
  • Misplacing Condition inside Action

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More AWS Quizzes