Bird
0
0

Find the mistake in this IAM policy snippet:

medium📝 Debug Q7 of 15
AWS - Identity and Access Management
Find the mistake in this IAM policy snippet:
{"Effect": "Allow", "Action": "ec2:DescribeInstances", "Resource": "*", "Condition": {"StringEquals": {"ec2:Region": "us-west-2"}}}
AThe "Condition" key is not valid for this action
B"Resource" cannot be "*" for EC2 actions
CThe policy is valid and has no mistakes
DThe condition key "ec2:Region" is invalid
Step-by-Step Solution
Solution:
  1. Step 1: Check if "Condition" is allowed with this action

    Conditions can be applied to EC2 actions, including region restrictions.
  2. Step 2: Verify the resource and condition keys

    "Resource": "*" is valid for DescribeInstances, and "ec2:Region" is a valid condition key.
  3. Final Answer:

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

    Valid condition + resource = The policy is valid and has no mistakes [OK]
Quick Trick: Conditions can restrict actions even with resource "*" [OK]
Common Mistakes:
MISTAKES
  • Assuming resource "*" is invalid for EC2
  • Thinking condition keys are always invalid
  • Ignoring valid use of conditions

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More AWS Quizzes