ANS-C01 Implicit Deny Practice Question
Exhibit
Refer to the exhibit.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ec2:DescribeInstances",
"ec2:DescribeSecurityGroups"
],
"Resource": "*"
},
{
"Effect": "Deny",
"Action": "ec2:RunInstances",
"Resource": "arn:aws:ec2:us-east-1:123456789012:instance/*",
"Condition": {
"StringNotEquals": {
"ec2:InstanceType": "t2.micro"
}
}
}
]
}An IAM policy is attached to a user. What is the effect when the user attempts to launch an EC2 instance of type m5.large?
⚠ Common exam trap
Candidates often confuse implicit deny with an explicit Deny statement. In this question, the policy does not contain an explicit Deny; instead, the Allow statement has a condition that is not met, resulting in the default implicit deny. A common error is to think that because there is no explicit Deny, the action would be allowed, but that is incorrect; the Action is denied because no applicable Allow exists.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
The action is denied because the instance type does not equal t2.micro.
The IAM policy attached to the user includes an Allow statement for ec2:RunInstances only when the condition ec2:InstanceType equals t2.micro. Since the user is attempting to launch an m5.large instance, the condition is not satisfied, and the Allow statement does not apply. Consequently, the default implicit deny takes effect, and the action is denied. It is not an explicit denial but rather the absence of an applicable Allow.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
The action is allowed because the policy allows t2.micro instances.
Why it's wrong here
The policy only denies non-t2.micro; it does not explicitly allow t2.micro.
- ✗
The action is allowed because there is no explicit allow for RunInstances.
Why it's wrong here
Deny statements override allows.
- ✗
The action is denied because the condition is not met.
Why it's wrong here
The condition is met (instance type is not t2.micro), so denial applies.
- ✓
The action is denied because the instance type does not equal t2.micro.
Why this is correct
The Deny statement with the condition StringNotEquals blocks all instance types except t2.micro.
Go deeper
Related to this question
About these practice questions
Courseiva writes every ANS-C01 question from scratch — 1,621 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This ANS-C01 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the ANS-C01 exam.