DVA-C02 Deployment Practice Question
A company uses AWS CodeCommit for source control. A developer needs to automate the build and test process for every commit to the 'develop' branch. The developer creates a CodeBuild project and wants to trigger it automatically. What is the most efficient way to set up this automation?
⚠ Common exam trap
The trap here is that candidates may overcomplicate the solution by considering event-driven services like CloudWatch Events or SQS, when the simplest and most efficient approach is to use CodePipeline's native source-to-build integration, which is purpose-built for this exact scenario.
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 a CodePipeline with a source stage from CodeCommit and a build stage from CodeBuild
AWS CodePipeline is the most efficient and fully managed way to orchestrate a continuous integration workflow. It natively integrates CodeCommit as a source action that automatically detects changes on the specified branch (e.g., 'develop') and triggers a CodeBuild build stage without any custom scripting or additional infrastructure. This provides built-in retry, status tracking, and seamless integration with other AWS services.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Create a CloudWatch Events rule that triggers CodeBuild on code commit events
Why it's wrong here
Creating a CloudWatch Events rule to trigger CodeBuild on CodeCommit events is technically feasible but introduces unnecessary complexity. While CloudWatch Events (now EventBridge) can detect CodeCommit repository changes and invoke a CodeBuild project, this method requires manual configuration of the event pattern and the CodeBuild project's source. It lacks the integrated artifact management, sequential stage execution, and simplified setup that AWS CodePipeline natively provides for CI/CD workflows, making it a less efficient choice.
- ✗
Configure a webhook in CodeCommit to call CodeBuild directly
Why it's wrong here
CodeCommit does not natively support configuring a direct webhook to call CodeBuild projects. While CodeCommit can trigger notifications via Amazon SNS or invoke AWS Lambda functions for repository events, there isn't a built-in feature to directly send a webhook payload to CodeBuild. Implementing such a connection would require an intermediary service, adding complexity and deviating from the intended native integration patterns within the AWS developer tools suite.
- ✓
Create a CodePipeline with a source stage from CodeCommit and a build stage from CodeBuild
Why this is correct
Creating an AWS CodePipeline with CodeCommit as the source stage and CodeBuild as the build stage is the most appropriate and recommended solution. CodePipeline is purpose-built for continuous integration and continuous delivery (CI/CD) workflows, offering seamless, native integration between these services. It automatically detects changes in the CodeCommit repository, orchestrates the build process in CodeBuild, and manages artifact passing between stages, providing a fully automated and efficient pipeline.
- ✗
Use an SQS queue to receive SNS notifications from CodeCommit and trigger CodeBuild
Why it's wrong here
Using an SQS queue to receive SNS notifications from CodeCommit and then trigger CodeBuild is an overly complex and inefficient approach. While CodeCommit can publish events to SNS, and SNS can deliver to SQS, an additional compute layer, such as an AWS Lambda function, would be required to poll the SQS queue, parse the event, and then invoke CodeBuild. This introduces unnecessary architectural components, increases latency, and adds operational overhead compared to CodePipeline's direct integration.
Go deeper
Related to this question
About these practice questions
One of 1,135 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.