SAP-C02 Practice Question: Accelerate Workload Migration and Modernization
Exhibit
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::my-bucket/*",
"Condition": {
"IpAddress": {
"aws:SourceIp": "10.0.0.0/16"
}
}
}
]
}Refer to the exhibit. A company has attached this IAM policy to an IAM role used by an application running on an EC2 instance in a VPC with CIDR 10.0.0.0/16. The application is unable to read objects from the S3 bucket. What is the most likely cause?
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 condition key aws:SourceIp uses the private IP of the instance, but S3 sees the public IP.
The IAM policy uses the `aws:SourceIp` condition key with the private IP address of the EC2 instance (10.0.0.x). However, when the instance accesses S3, the request originates from the instance's public IP address (or the NAT gateway's public IP). Since the `aws:SourceIp` condition checks the source IP of the request, and it expects the private IP, the condition fails and denies access to the S3 bucket. Therefore, the most likely cause is that the condition key uses the private IP but S3 sees the public IP (option C). Option A is incorrect because the instance has an IAM role attached (implied by the policy being attached to the role). Option B is incorrect because the `s3:GetObject` action is allowed, and `s3:ListBucket` is not required to read objects if the bucket policy allows it. Option D is incorrect because the bucket policy is not mentioned and the issue lies with the IAM policy condition.
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 EC2 instance does not have an IAM instance profile.
Why it's wrong here
The role is attached, so it does.
- ✗
The policy does not allow the s3:ListBucket action.
Why it's wrong here
The application is reading objects, not listing.
- ✓
The condition key aws:SourceIp uses the private IP of the instance, but S3 sees the public IP.
Why this is correct
The condition fails because traffic to S3 originates from the public IP.
- ✗
The S3 bucket policy denies access.
Why it's wrong here
No bucket policy is shown.
Visual reference
Quick reference
AWS S3 Storage Class Comparison
| Storage Class | Min Duration | Retrieval | Use Case |
|---|---|---|---|
| S3 Standard | None | Immediate | Frequently accessed data |
| S3 Standard-IA | 30 days | Immediate | Infrequent access, rapid retrieval |
| S3 One Zone-IA | 30 days | Immediate | Non-critical infrequent data |
| S3 Intelligent-Tiering | None | Immediate–hours | Unknown or changing access patterns |
| S3 Glacier Instant | 90 days | Milliseconds | Archive with instant retrieval |
| S3 Glacier Flexible | 90 days | Minutes–hours | Archive, flexible retrieval |
| S3 Glacier Deep Archive | 180 days | Hours | Long-term compliance archive |
Go deeper
Related to this question
About these practice questions
Courseiva writes every SAP-C02 question from scratch — 1,660 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 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.