DOP-C02 SDLC Automation Practice Question
A DevOps team is designing a CI/CD pipeline for a microservices application. Each service is stored in a separate repository. The team wants to build and test only the services that changed in a given commit. Which AWS solution is MOST efficient and cost-effective?
⚠ Common exam trap
The trap here is that candidates may overcomplicate the solution by choosing EventBridge and Lambda (Option D) for change detection, missing that CodeBuild webhooks with buildspec filters provide a simpler, built-in, and more cost-effective mechanism for selective builds.
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
✓
Use AWS CodeBuild with a webhook that triggers builds only for repositories where files changed, using buildspec filters.
AWS CodeBuild webhooks can be configured with buildspec filter patterns (e.g., using `git diff` or path-based globs) to trigger builds only for repositories where files changed. This avoids unnecessary builds for unchanged services, making it both efficient and cost-effective by minimizing compute time and resource usage.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Use AWS CodeCommit triggers with Amazon SNS to send notifications and then manually trigger builds.
Why it's wrong here
CodeCommit triggers can emit SNS notifications, but they cannot directly invoke AWS CodeBuild, so an operator must manually start each build. This reintroduces human latency and error, violates the 'automate everything' principle of CI/CD, and is impossible to scale across many microservices because every change requires someone to notice the notification and act on it.
- ✓
Use AWS CodeBuild with a webhook that triggers builds only for repositories where files changed, using buildspec filters.
Why this is correct
AWS CodeBuild webhooks natively support filter groups that include FILEPATH patterns, allowing you to trigger a build only when a committed file under a specified path (e.g., 'services/payment/**') changes. Each microservice can have its own CodeBuild project and webhook, so commits to unrelated services do not waste compute time. Additionally, the buildspec can further refine the build with conditional phases, giving precise, automated control without custom infrastructure.
- ✗
Use AWS CodePipeline with a single pipeline that builds all services on every commit.
Why it's wrong here
A single AWS CodePipeline with all services in one pipeline rebuilds and redeploys every microservice for every commit, regardless of which code actually changed. This is inefficient and expensive because it consumes unnecessary compute, lengthens feedback cycles, and tightly couples independent services into one deployment unit; a failure in one microservice's build blocks all others. CodePipeline also lacks native file-path filtering, so it cannot restrict execution to only the services affected by a commit.
- ✗
Use Amazon EventBridge to detect repository changes and trigger AWS Lambda functions that determine which services changed.
Why it's wrong here
Amazon EventBridge can detect CodeCommit repository changes, but routing them to AWS Lambda to compute which services changed adds a custom execution layer that is not needed. The Lambda function must be written, tested, logged, and monitored, increasing complexity and introducing a new failure point between the repository and the build. CodeBuild webhooks already provide built-in file-path filtering, so this approach duplicates functionality with extra operational overhead and latency.
Go deeper
Related to this question
About these practice questions
This DOP-C02 question is part of Courseiva's 1,298-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam 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.