DOP-C02 SDLC Automation Practice Question
Which THREE components are required to set up a fully automated CI/CD pipeline for a static website hosted on Amazon S3 using AWS CodePipeline? (Choose THREE.)
⚠ Common exam trap
Test-takers frequently confuse optional performance enhancements (CloudFront) or cache invalidation mechanisms (Lambda) as mandatory pipeline components, when the question specifically asks for the three required components to set up a fully automated CI/CD pipeline for a static website hosted on S3.
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
✓
An AWS CodeBuild project to run build commands (e.g., minification)
AWS CodeBuild is required to execute build commands such as minification, bundling, or transpilation of static website assets before deployment. In a fully automated CI/CD pipeline, CodeBuild processes the source code from the repository and produces the deployable artifacts that are then uploaded to the S3 bucket.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
An AWS CodeBuild project to run build commands (e.g., minification)
Why this is correct
CodeBuild is the required compute stage in a static website pipeline: it pulls the source from CodeCommit, executes build commands such as minification, Sass compilation, or image optimization, and outputs the production-ready artifacts to a staging location. Without a build project, the pipeline would simply copy raw source files, missing any transformation needed for the final site. CodeBuild integrates directly with CodePipeline and writes artifacts to S3, making it the only component explicitly running build commands.
- ✗
An Amazon CloudFront distribution for content delivery
Why it's wrong here
CloudFront is an optional CDN layer that provides edge caching, custom domain names (via alternate CNAMEs), and HTTPS, but S3 static website hosting already serves content publicly over HTTP. Since the question asks for components required for a fully automated static website pipeline, CloudFront is not necessary — the automation can build and deploy to S3 alone, and visitors can access the site via the S3 website endpoint. Cache invalidation, if you do later add CloudFront, is a separate operational concern that does not make the distribution a prerequisite.
- ✓
An AWS CodeCommit repository to store the website source code
Why this is correct
A CodeCommit repository is required because the pipeline's Source stage must pull website source code from a version-controlled, immutable origin. CodePipeline natively supports CodeCommit as a source action, triggering the pipeline automatically on commits via CloudWatch Events or webhooks. Without a Git repository there is no deterministic point-in-time source to feed into the build stage, so the entire automated workflow lacks its starting artifact.
- ✓
An S3 bucket configured for static website hosting as the deployment target
Why this is correct
An S3 bucket configured for static website hosting is the deployment target: after CodeBuild produces the optimized files, the Deploy stage uploads them to the bucket, which serves the public site with an index document, error document, and directory routing. To function correctly, the bucket must have 'Static website hosting' enabled and a bucket policy allowing public read access, since website hosting requires anonymous GETs. Without this bucket, the built artifacts have nowhere to be placed for user access, so it is an essential component.
- ✗
An AWS Lambda function to invalidate CloudFront cache
Why it's wrong here
A Lambda function to invalidate CloudFront cache is not a required component for automating a static website pipeline. Cache invalidation only becomes relevant if you also choose to add CloudFront, which is optional; moreover, CodePipeline can perform invalidation natively through an S3 deploy action enhanced by CloudFront, or by running an AWS CLI command within a CodeBuild stage. Adding Lambda introduces an extra compute function and IAM role, increasing complexity and cost with no necessity for the core build-and-deploy pipeline.
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 by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
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.