DOP-C02 SDLC Automation Practice Question
A company uses AWS CodePipeline to automate the deployment of a static website hosted on Amazon S3. The pipeline includes a source stage that pulls from a CodeCommit repository and a deploy stage that uses CodeBuild to sync the files to an S3 bucket. The team noticed that the website is not updating after a successful pipeline run. The CodeBuild logs show that the 'aws s3 sync' command completed successfully. However, the website still shows the old content. What is the MOST likely cause?
⚠ Common exam trap
DOP-C02 often tests the trap that a successful S3 sync means the website is updated, ignoring CloudFront caching, so candidates blame IAM or bucket policies instead of the CDN layer.
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 website is fronted by Amazon CloudFront, which is caching the old content.
The most likely cause is that Amazon CloudFront is caching the old content at edge locations. Even though CodeBuild successfully synced new files to S3, CloudFront continues to serve cached objects until the TTL expires or an invalidation is created. The pipeline must include a CloudFront invalidation step (or use versioned object keys) to force edge locations to fetch the updated content.
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 CodeBuild project does not have permission to write to the S3 bucket.
Why it's wrong here
The CodeBuild execution role's IAM policy must include s3:PutObject and s3:ListBucket for the target bucket. The deployment logs show the sync completed without AccessDenied errors, which proves the role's credentials were accepted by S3. If write permission were missing, the sync would terminate with a 403 exception before any content could be updated, so this cannot be the root cause.
- ✗
The S3 bucket is not configured for static website hosting.
Why it's wrong here
Static website hosting is a one-time bucket property that creates a unique website endpoint. Because the site was accessible before the pipeline update, the bucket already has 'Static website hosting' enabled with an index document. The pipeline's sync operation only writes objects and never modifies the hosting configuration, so a disabled hosting feature would make the entire site unavailable rather than just serving old content.
- ✓
The website is fronted by Amazon CloudFront, which is caching the old content.
Why this is correct
When CloudFront fronts an S3 static website, edge locations serve cached objects until they expire or are invalidated. CodePipeline's S3 sync updates the origin, but CloudFront does not automatically know about those changes; it continues returning the old objects as long as they remain in the cache. To serve the new content, you must create a CloudFront invalidation for the changed paths (e.g., /*) or use versioned filenames to bypass the cache. This directly matches the symptom of a successful deployment that still shows stale content in the browser.
- ✗
The S3 bucket policy is blocking public access to the updated objects.
Why it's wrong here
An S3 bucket policy that grants public read access (e.g., s3:GetObject on /*) applies uniformly to all objects, including newly synced ones, because it is a resource-based policy evaluated at the time of each request. The sync itself succeeds because the CodeBuild role is explicitly allowed to write, so the policy is not blocking the deployment. If the policy were truly blocking public access, both old and new objects would return 403 Forbidden, making the stale content symptom impossible.
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 DOP-C02 question from scratch — 1,298 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 and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official Amazon Web Services exam blueprint
This DOP-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 DOP-C02 exam.