DVA-C02 Troubleshooting and Optimization Practice Question
A development team is using AWS CodeCommit as a source repository and CodeBuild for build automation. They want to trigger a build automatically whenever a pull request is created or updated in the repository. Which configuration should they use?
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 Amazon EventBridge to capture CodeCommit events and trigger CodeBuild
The correct option is C: use Amazon EventBridge to capture CodeCommit events and trigger CodeBuild. CodeCommit emits pull request state-change events (e.g., pullRequestCreated and pullRequestSourceBranchUpdated) to the default EventBridge bus, and an EventBridge rule can match those events and invoke CodeBuild as a target, which is the supported way to start builds on pull request creation or updates. Option A is wrong because S3 event notifications apply to S3 buckets, not CodeCommit repositories. Option B is wrong because CodeCommit webhooks are not a native trigger mechanism for CodeBuild in this pull request scenario. Option D is wrong because CodePipeline polling detects branch commits, not pull request creation/update events, and polling is not event-driven.
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 an S3 event notification on the repository
Why it's wrong here
Amazon S3 event notifications are specifically designed to react to changes within S3 buckets, such as object creation, deletion, or modification. CodeCommit repositories, however, store Git repository data and metadata directly within the CodeCommit service itself, not in user-accessible S3 buckets that can be configured for direct event notifications. Therefore, attempting to configure S3 event notifications on a CodeCommit repository is fundamentally incompatible with CodeCommit's architecture and will not detect code changes or pull request activities.
- ✗
Configure a webhook in CodeCommit to trigger CodeBuild
Why it's wrong here
While many source control systems support webhooks for external integrations, AWS CodeCommit does not natively provide a direct webhook configuration mechanism that can be pointed to an arbitrary URL. Instead, CodeCommit publishes various events, such as push events or pull request state changes, to Amazon EventBridge. To trigger services like CodeBuild, an EventBridge rule must be configured to capture these specific CodeCommit events and then invoke the target, making a direct webhook configuration an invalid approach.
- ✓
Use Amazon EventBridge to capture CodeCommit events and trigger CodeBuild
Why this is correct
Amazon EventBridge is the correct and recommended service for integrating CodeCommit with other AWS services based on repository events. CodeCommit automatically publishes various events, including repository pushes, pull request creations, and state changes, to EventBridge. A specific EventBridge rule can then be configured to filter for desired CodeCommit event patterns and directly invoke AWS CodeBuild as a target, initiating a build process in response to code changes or pull request activity. This provides a robust, serverless, and event-driven integration.
- ✗
Create a CodePipeline that polls CodeCommit for changes
Why it's wrong here
AWS CodePipeline can indeed use CodeCommit as a source stage and automatically detect changes to trigger a pipeline, which can then include a CodeBuild action. However, CodePipeline is primarily designed to orchestrate multi-stage release processes, and its 'polling' for changes is often implemented internally via EventBridge or webhooks for efficiency, not literal continuous polling. For the specific requirement of simply triggering CodeBuild directly from CodeCommit events, introducing a full CodePipeline adds unnecessary overhead and complexity compared to a direct EventBridge integration.
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
This DVA-C02 question is part of Courseiva's 1,135-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 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.