SAP-C02 Continuous Improvement for Existing Solutions Practice Question
Exhibit
Refer to the exhibit.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "s3:PutObject",
"Resource": "arn:aws:s3:::my-bucket/*",
"Condition": {
"StringEquals": {
"s3:x-amz-server-side-encryption": "AES256"
}
}
},
{
"Effect": "Deny",
"Action": "s3:PutObject",
"Resource": "arn:aws:s3:::my-bucket/*",
"Condition": {
"StringNotEquals": {
"s3:x-amz-server-side-encryption": "AES256"
}
}
}
]
}A solutions architect applies the IAM policy shown in the exhibit to an IAM user. The user attempts to upload an object to the S3 bucket 'my-bucket' without specifying the 'x-amz-server-side-encryption' header. What will happen?
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 upload fails because the Deny statement blocks any PutObject request that does not specify AES256 encryption.
The Deny statement with a StringNotEquals condition on the 's3:x-amz-server-side-encryption' header will block any PutObject request where the header is not present or is set to a value other than 'AES256'. Since the user does not specify the header, the condition evaluates to true, and the Deny applies, causing the upload to fail. Option B is incorrect because the Deny statement applies even when the header is missing, not only when it is present with a different value. Option A is incorrect because the Allow statement's condition is not met, so it does not grant permission. Option D is incorrect because the condition is valid and correctly evaluated.
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 upload succeeds because the Allow statement grants the s3:PutObject permission.
Why it's wrong here
The Allow statement has a condition that is not satisfied, so it does not grant permission.
- ✗
The upload succeeds because the Deny statement only applies when the header is present but set to a value other than AES256.
Why it's wrong here
The Deny applies when the header is not equal to AES256; missing header is not equal.
- ✓
The upload fails because the Deny statement blocks any PutObject request that does not specify AES256 encryption.
Why this is correct
The Deny statement with StringNotEquals denies if encryption header is not present or not AES256.
- ✗
The upload fails because the condition is malformed and causes an error.
Why it's wrong here
The condition is valid; it uses StringNotEquals correctly.
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.