Question 645 of 1,616
SecurityhardMultiple ChoiceObjective-mapped

Quick Answer

The answer is to check the S3 bucket policy for an explicit deny statement that applies to the IAM role. This is correct because AWS IAM policy evaluation logic dictates that an explicit deny in any policy—whether identity-based (like the IAM role) or resource-based (like the bucket policy)—always overrides any allow. Even if your IAM role grants s3:GetObject, a bucket policy with an explicit deny targeting that role will cause access denied errors, as the deny takes precedence. On the AWS Certified Developer Associate DVA-C02 exam, this scenario tests your understanding of the “explicit deny overrides allow” rule, a common trap where developers assume the IAM role alone is sufficient. A frequent memory tip is to remember the order: default deny, then allow, then explicit deny—the explicit deny is the final word. So when troubleshooting S3 access denied despite IAM role allowing access, always inspect the bucket policy first for any “Deny” effect statements.

DVA-C02 Security Practice Question

This DVA-C02 practice question tests your understanding of security. 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.

An application running on EC2 needs to access an S3 bucket. The developer has assigned an IAM role to the EC2 instance with a policy that allows s3:GetObject on the bucket. However, the application is still getting access denied errors. What should the developer check?

Question 1hardmultiple choice
Full question →

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

Check the S3 bucket policy for an explicit deny statement that applies to the IAM role.

Option B is correct because even if the IAM role attached to the EC2 instance allows s3:GetObject, an S3 bucket policy with an explicit deny statement that applies to that role will override the allow. IAM policy evaluation logic dictates that an explicit deny in any policy (resource-based or identity-based) takes precedence over any allow, resulting in access denied errors.

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.

  • Check that the application is using HTTPS instead of HTTP.

    Why it's wrong here

    HTTP is allowed; only an explicit bucket policy requiring HTTPS would cause denial.

  • Check the S3 bucket policy for an explicit deny statement that applies to the IAM role.

    Why this is correct

    An explicit deny in the bucket policy overrides any allow from IAM.

    Related concept

    Read the scenario before looking for a memorised answer.

  • Check that the EC2 instance has permissions to decrypt the KMS key used by S3.

    Why it's wrong here

    Only relevant if S3 uses SSE-KMS, but the question does not indicate that.

  • Check that the EC2 instance is in the same VPC as the S3 bucket.

    Why it's wrong here

    S3 is a global service; VPC is not required.

Common exam traps

Common exam trap: answer the scenario, not the keyword

The trap here is that candidates assume an IAM role with an allow policy is sufficient, overlooking that S3 bucket policies can contain explicit deny statements that override the role's permissions.

Detailed technical explanation

How to think about this question

IAM policy evaluation follows a hierarchy: explicit deny overrides any allow, and if both an identity-based policy (IAM role) and a resource-based policy (bucket policy) apply, the effective permission is the union of all allows minus any explicit denies. A common subtlety is that a bucket policy can deny access to a specific IAM role even if that role has a permissive IAM policy, which is why checking for explicit deny statements in the bucket policy is critical. In real-world scenarios, this often occurs when a bucket policy has a condition like 'Deny if NotIpAddress' that inadvertently blocks the EC2 instance's traffic.

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.

Related practice questions

Related DVA-C02 practice-question pages

Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.

Practice this exam

Start a free DVA-C02 practice session

Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.

FAQ

Questions learners often ask

What does this DVA-C02 question test?

Security — This question tests Security — Read the scenario before looking for a memorised answer..

What is the correct answer to this question?

The correct answer is: Check the S3 bucket policy for an explicit deny statement that applies to the IAM role. — Option B is correct because even if the IAM role attached to the EC2 instance allows s3:GetObject, an S3 bucket policy with an explicit deny statement that applies to that role will override the allow. IAM policy evaluation logic dictates that an explicit deny in any policy (resource-based or identity-based) takes precedence over any allow, resulting in access denied errors.

What should I do if I get this DVA-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 →

How Courseiva writes practice questions · Editorial policy

Keep practising

More DVA-C02 practice questions

Last reviewed: Jun 24, 2026

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.

Loading comments…

Sign in to join the discussion.

This DVA-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 DVA-C02 exam.