The answer is that access is denied because the user’s IP is not within the allowed range. This occurs because the S3 bucket policy includes a condition block that explicitly denies access to all principals except those originating from a specific IP address range, and in AWS IAM, an explicit deny always overrides any allow statement. On the AWS Certified Solutions Architect Professional SAP-C02 exam, this scenario tests your understanding of how S3 bucket policy IP address restriction deny logic interacts with IAM evaluation, often appearing as a trick where candidates assume an allow for a different principal would grant access. A common trap is forgetting that an explicit deny in the condition block applies globally, even if the user has other permissions. Memory tip: “Explicit deny is the final veto—no IP, no entry.”
SAP-C02 Design for New Solutions Practice Question
This SAP-C02 practice question tests your understanding of design for new solutions. Match the stated requirement to the specific cloud service, access model, or configuration option — many options are valid in isolation but not for this scenario. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.
The above AWS CloudFormation template creates an S3 bucket with a bucket policy. A user from IP 198.51.100.5 tries to access an object in the bucket. What will happen?
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Access is denied because the IP is not allowed.
The bucket policy explicitly denies access to all principals except those coming from the allowed IP address range (which does not include 198.51.100.5). In AWS IAM, an explicit deny overrides any allow, so the request from IP 198.51.100.5 is denied. Option D is correct because the policy's condition block restricts access to a specific IP range, and the user's IP is not within that range.
Key principle: Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
✗
Access is allowed because the Principal is "*".
Why it's wrong here
The Principal is "*", but the Condition restricts by IP.
✗
Access is denied because the bucket is not public.
Why it's wrong here
The bucket policy allows access, but only from specific IPs.
✗
Access is allowed because the policy does not explicitly deny.
Why it's wrong here
Deny is not required; the Allow only applies to the IP range.
✓
Access is denied because the IP is not allowed.
Why this is correct
The policy restricts access to the specified IP range.
Related concept
Read the scenario before looking for a memorised answer.
Common exam traps
Common exam trap: answer the scenario, not the keyword
The trap here is that candidates often assume a bucket policy with Principal '*' automatically allows all access, ignoring the condition block that can restrict access based on IP address or other attributes.
Detailed technical explanation
How to think about this question
The bucket policy uses a 'Deny' effect with a 'NotIpAddress' condition, which creates an explicit deny for any request that does not originate from the specified IP range. In AWS IAM policy evaluation, an explicit deny always overrides any allow, even if the allow is granted by the same policy or another policy. This is a common pattern for enforcing IP-based access controls on S3 buckets, and it ensures that even if the bucket is accidentally made public, only traffic from the allowed IPs can access the objects.
KKey Concepts to Remember
Read the scenario before looking for a memorised answer.
Find the constraint that changes the correct option.
Eliminate answers that are true in general but not in this case.
TExam Day Tips
→Watch for words such as best, first, most likely and least administrative effort.
→Review why wrong options are wrong, not only why the correct option is correct.
Key takeaway
Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.
Real-world example
How this comes up in practice
A media company stores terabytes of video archives that are accessed once a year for audit purposes. Moving these objects to a cold storage tier (Azure Archive, S3 Glacier, or Google Nearline) costs a fraction of hot storage. Questions like this test whether you understand storage tiers, access frequency tradeoffs, and retrieval latency requirements.
What to study next
Got this wrong? Here's your next step.
Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.
Design for New Solutions — This question tests Design for New Solutions — Read the scenario before looking for a memorised answer..
What is the correct answer to this question?
The correct answer is: Access is denied because the IP is not allowed. — The bucket policy explicitly denies access to all principals except those coming from the allowed IP address range (which does not include 198.51.100.5). In AWS IAM, an explicit deny overrides any allow, so the request from IP 198.51.100.5 is denied. Option D is correct because the policy's condition block restricts access to a specific IP range, and the user's IP is not within that range.
What should I do if I get this SAP-C02 question wrong?
Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.
What is the key concept behind this question?
Read the scenario before looking for a memorised answer.
About these practice questions
Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →
Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.
This SAP-C02 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 SAP-C02 exam.
Question Discussion
Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.
Sign in to join the discussion.