Question 1,389 of 1,616
Development with AWS ServicesmediumMultiple ChoiceObjective-mapped

IAM Policy NotIpAddress Condition

This DVA-C02 practice question tests your understanding of development with aws services. 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. A key principle to apply: iAM Policy. 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.

Exhibit

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "s3:PutObject",
        "s3:GetObject",
        "s3:DeleteObject"
      ],
      "Resource": "arn:aws:s3:::example-bucket/*",
      "Condition": {
        "IpAddress": {
          "aws:SourceIp": "192.0.2.0/24"
        }
      }
    }
  ]
}

Refer to the exhibit. An IAM policy is attached to an IAM user. The user tries to upload an object to the S3 bucket 'example-bucket' from an IP address 198.51.100.5. What will happen?

Exhibit

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "s3:PutObject",
        "s3:GetObject",
        "s3:DeleteObject"
      ],
      "Resource": "arn:aws:s3:::example-bucket/*",
      "Condition": {
        "IpAddress": {
          "aws:SourceIp": "192.0.2.0/24"
        }
      }
    }
  ]
}

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 request is allowed because the action s3:PutObject is allowed.

The IAM policy includes a condition that allows the s3:PutObject action only if the request originates from a specific IP address or range. The user's IP address 198.51.100.5 matches this condition, so the request is allowed. Therefore, option B is correct.

Key principle: IAM Policy

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 request is allowed because the user is an IAM user.

    Why it's wrong here

    This is incorrect because being an IAM user alone does not automatically allow the action; the policy must explicitly grant permission.

  • The request is allowed because the action s3:PutObject is allowed.

    Why this is correct

    This is correct. The user has the s3:PutObject permission via the IAM policy, and the source IP condition is satisfied, so the request is allowed.

    Related concept

    IAM Policy

  • The request is denied because the source IP does not match the condition.

    Why it's wrong here

    This is incorrect. The source IP does match the condition, so the request is not denied due to IP mismatch.

  • The request is denied because the bucket policy is missing.

    Why it's wrong here

    This is incorrect. S3 bucket policies are not required for this action; IAM policies can grant permissions directly.

Common exam traps

Common exam trap: answer the scenario, not the keyword

The trap here is that candidates may overlook the condition in the IAM policy and assume that any IP outside the allowed range would be denied. However, in this scenario the IP matches, so the request is allowed. Candidates might also confuse Allow and Deny evaluation logic.

Detailed technical explanation

How to think about this question

IAM policy evaluation logic uses an explicit deny override: if a `Deny` statement applies, the request is denied regardless of any `Allow` statements. Here, the `Deny` with `NotIpAddress` only applies when the source IP is outside the specified range, so for IP `198.51.100.5` (inside the range), the `Deny` does not trigger, and the `Allow` statement permits the upload. This demonstrates the importance of understanding how condition keys like `aws:SourceIp` interact with `NotIpAddress` to create IP-based access controls, commonly used in security-sensitive environments to restrict API calls to trusted networks.

KKey Concepts to Remember

  • IAM Policy
  • Condition
  • s3:PutObject

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

IAM Policy

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.

Quick reference

AWS S3 Storage Class Comparison

Storage ClassMin DurationRetrievalUse Case
S3 StandardNoneImmediateFrequently accessed data
S3 Standard-IA30 daysImmediateInfrequent access, rapid retrieval
S3 One Zone-IA30 daysImmediateNon-critical infrequent data
S3 Intelligent-TieringNoneImmediate–hoursUnknown or changing access patterns
S3 Glacier Instant90 daysMillisecondsArchive with instant retrieval
S3 Glacier Flexible90 daysMinutes–hoursArchive, flexible retrieval
S3 Glacier Deep Archive180 daysHoursLong-term compliance archive

What to study next

Got this wrong? Here's your next step.

Review iAM Policy, then practise related DVA-C02 questions on the same topic to reinforce the concept.

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?

Development with AWS Services — This question tests Development with AWS Services — IAM Policy.

What is the correct answer to this question?

The correct answer is: The request is allowed because the action s3:PutObject is allowed. — The IAM policy includes a condition that allows the s3:PutObject action only if the request originates from a specific IP address or range. The user's IP address 198.51.100.5 matches this condition, so the request is allowed. Therefore, option B is correct.

What should I do if I get this DVA-C02 question wrong?

Review iAM Policy, then practise related DVA-C02 questions on the same topic to reinforce the concept.

What is the key concept behind this question?

IAM Policy

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

Same concept, more angles

1 more ways this is tested on DVA-C02

These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.

Variation 1. A developer attaches this IAM policy to an IAM user. The user tries to upload an object to the S3 bucket my-bucket from an IP address of 10.0.1.5. What will happen?

hard
  • A.The upload will fail because the IP address is not within the allowed range.
  • B.The upload will fail because the bucket policy denies access.
  • C.The upload will succeed because the policy allows s3:PutObject.
  • D.The upload will succeed because the condition is ignored for uploads.

Why A: The IAM policy includes an explicit deny for s3:PutObject when the source IP is not within the 10.0.0.0/24 range. The user's IP 10.0.1.5 is outside this range, so the deny condition is met, causing the upload to fail. Answer A is correct because the IP is not within the allowed range.

Keep practising

More DVA-C02 practice questions

Last reviewed: Jul 4, 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.