DVA-C02 Development with AWS Services Practice Question
A developer is using AWS CodeCommit as a source repository and AWS CodePipeline for CI/CD. The developer wants to automatically trigger a pipeline execution when changes are pushed to the main branch. Which action should the developer take?
⚠ Common exam trap
A common mix-up: candidates confuse CodeCommit with GitHub or Bitbucket, assuming webhooks are available, but AWS CodeCommit relies on CloudWatch Events for event-driven triggers instead.
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
✓
Create an Amazon CloudWatch Events rule that detects changes to the CodeCommit repository and triggers the pipeline.
Amazon CloudWatch Events (now Amazon EventBridge) can detect CodeCommit repository state changes, such as push events to a specific branch, and automatically trigger a CodePipeline execution as a target. This is the recommended AWS-native approach for event-driven pipeline triggers without polling or manual webhook configuration.
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 CodePipeline to poll the CodeCommit repository every minute.
Why it's wrong here
AWS CodePipeline does not directly poll CodeCommit repositories for changes. Instead, CodePipeline integrates with CodeCommit through an event-driven mechanism. When CodeCommit is configured as a source, CodePipeline automatically sets up a CloudWatch Events rule to detect repository changes, ensuring immediate pipeline execution upon a push rather than relying on inefficient periodic checks.
- ✗
Set up a webhook in CodeCommit to notify CodePipeline on push events.
Why it's wrong here
AWS CodeCommit does not natively support webhooks for direct integration with other services. Unlike platforms such as GitHub or GitLab, CodeCommit relies on AWS CloudWatch Events to publish repository events, including pushes, merges, and comments. Therefore, attempting to configure a webhook directly within CodeCommit to trigger CodePipeline is not a supported mechanism.
- ✓
Create an Amazon CloudWatch Events rule that detects changes to the CodeCommit repository and triggers the pipeline.
Why this is correct
This is the correct and recommended approach for integrating CodeCommit with CodePipeline. An Amazon CloudWatch Events rule can be configured to monitor specific events within a CodeCommit repository, such as a ReferenceCreated or ReferenceUpdated event, which signifies a push to a branch. Upon detecting such an event, the rule can directly invoke AWS CodePipeline, initiating a new pipeline execution automatically and efficiently.
- ✗
Use an SNS topic to send a notification to CodePipeline when a push occurs.
Why it's wrong here
While Amazon SNS can be used to publish notifications about CodeCommit events, it does not directly trigger AWS CodePipeline executions. CodePipeline requires specific event sources, such as CloudWatch Events, to initiate its workflow. To use SNS in this scenario, an intermediary service like AWS Lambda would be necessary to subscribe to the SNS topic and then programmatically invoke CodePipeline, adding unnecessary complexity compared to the direct CloudWatch Events integration.
Go deeper
Related to this question
About these practice questions
Courseiva writes every DVA-C02 question from scratch — 724 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 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.