DVA-C02 Development with AWS Services Practice Question
A company uses AWS CodeCommit and wants to automatically trigger a build in AWS CodePipeline when code is pushed to the master branch. Which action should be taken?
⚠ Common exam trap
Watch out — candidates often confuse CodeCommit's integration with webhooks (which work with external Git providers) and assume CodeCommit supports them natively, or they overcomplicate the solution by suggesting polling or S3 triggers instead of using the native CloudWatch Events integration.
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
✓
Configure a CloudWatch Events rule to start the pipeline on repository changes
AWS CodePipeline can be configured to automatically start when changes are pushed to a CodeCommit repository by using an Amazon CloudWatch Events rule. The rule listens for CodeCommit repository state changes (e.g., 'ReferenceCreated' or 'ReferenceUpdated' events on the master branch) and targets the pipeline as a CloudWatch Events target, triggering the pipeline execution without polling or manual intervention.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Configure a CloudWatch Events rule to start the pipeline on repository changes
Why this is correct
CloudWatch Events (now Amazon EventBridge) is the standard and most efficient mechanism for integrating AWS CodeCommit with AWS CodePipeline. CodeCommit automatically publishes events, such as ReferenceUpdated for code pushes, to CloudWatch Events. A rule can then be configured to filter these specific events from the CodeCommit repository and branch, triggering a CodePipeline execution as its target. This creates a real-time, event-driven CI/CD workflow.
- ✗
Add a webhook in CodeCommit to directly invoke CodePipeline
Why it's wrong here
AWS CodeCommit does not provide native support for outgoing webhooks that can directly invoke other AWS services like CodePipeline. While webhooks are common in other Git platforms for custom integrations, CodeCommit relies on its integration with CloudWatch Events (EventBridge) to notify other services of repository changes. Therefore, attempting to configure a direct webhook within CodeCommit to trigger a pipeline is not a supported feature.
- ✗
Set up a scheduled pipeline that polls CodeCommit every minute
Why it's wrong here
Configuring a scheduled pipeline to poll CodeCommit every minute is an inefficient and outdated method for detecting repository changes. Polling constantly consumes resources and makes unnecessary API calls, regardless of whether new code has been pushed, leading to increased operational costs and potential latency. The event-driven approach using CloudWatch Events is far superior, as it instantly reacts to actual changes without continuous resource consumption.
- ✗
Use an S3 trigger to start the pipeline when code is uploaded
Why it's wrong here
AWS CodeCommit is a Git-based source control service, meaning developers interact with it using standard Git commands to manage code repositories. Code is pushed to a Git repository, not uploaded as individual objects to an Amazon S3 bucket. Therefore, using an S3 trigger to start a pipeline based on CodeCommit changes is fundamentally incompatible with how CodeCommit operates, as S3 is a separate object storage service.
Go deeper
Related to this question
About these practice questions
One of 724 original DVA-C02 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This DVA-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 DVA-C02 exam.