Jeff’s Note #
Unlike generic exam dumps, ADH analyzes this scenario through the lens of a Real-World Lead Developer.
For AWS DVA-C02 candidates, the confusion often lies in knowing which AWS services to combine properly for minimal pipeline overhead while maintaining test automation. In production, this is about knowing exactly how to insert and configure build/test stages that integrate smoothly with GitHub sources without unnecessary complexity or duplication. Let’s drill down.
The Certification Drill (Simulated Question) #
Scenario #
InnovateX Labs is developing a web application with its source code hosted in a GitHub repository. They want to automate their deployment pipeline using AWS services. The current pipeline has the source stage configured to pull code directly from the GitHub repo’s main branch.
The engineering team now wants to ensure that the application’s unit tests, defined alongside the code, run automatically each time the pipeline runs, verifying code integrity before deployment. They want to accomplish this with the least additional setup and operational overhead in their AWS CodePipeline.
The Requirement: #
Determine what steps InnovateX Labs’ developers should take next to integrate automated unit testing of the GitHub code within CodePipeline with minimal configuration and complexity.
The Options #
-
A) Create an AWS CodeCommit repository. Migrate the source code and add build and test commands in the new repo’s build specification.
-
B) Create an AWS CodeBuild project. Define the build and test commands in the project’s buildspec.yml file.
-
C) Create an AWS CodeDeploy application. Embed unit test commands in the deployment scripts.
-
D) Add a CodePipeline action to the existing source stage. Configure it to invoke the new project and use the build artifact as input.
-
E) Add a new stage to the pipeline after the source stage. Add an action to that stage specifying the CodeBuild project as provider and use the source artifact as input.
Google adsense #
leave a comment:
Correct Answer #
B, E
Quick Insight: The Developer Imperative #
In developer-centric CI/CD pipelines, CodeBuild is the preferred service to perform build and test commands declaratively. Adding a distinct build stage after the source retrieval respects pipeline modularity and separation of concerns. This keeps the system clean, maintainable, and scales well as test complexity grows.
Content Locked: The Expert Analysis #
You’ve identified the answer. But do you know the implementation details that separate a Junior from a Senior?
The Expert’s Analysis #
Correct Answer #
Options B and E
The Winning Logic #
-
Option B: Creating an AWS CodeBuild project is the recommended way to run automated build and test commands as defined in a
buildspec.ymlfile. CodeBuild’s fully managed build environment is designed precisely for compiling, running tests, and producing artifacts. Placing build and test commands here is clean, repeatable, and integrates directly with CodePipeline. -
Option E: In AWS CodePipeline, adding a new stage after the source stage is the standard practice. This stage’s action uses the CodeBuild project as an action provider and consumes the source artifact. It cleanly separates code retrieval from building/testing. Using the source artifact as input guarantees the tests run against the exact checked-out code version.
The Trap (Distractor Analysis) #
-
Why not A? Moving source code to CodeCommit is unnecessary overhead. The question states the code is already in GitHub, which CodePipeline supports directly as a Source provider. Migrating increases operational burden and complexity.
-
Why not C? AWS CodeDeploy focuses on deployment strategies and orchestrations, not running build or test commands. Embedding unit tests in CodeDeploy scripts violates separation of concerns and is not best practice.
-
Why not D? Adding a build action to the existing source stage conflates the distinct actions of retrieving source code and running builds/tests. It’s technically possible but causes muddled pipeline structure and complicates artifact management.
The Technical Blueprint #
# Example CLI snippet to create a CodeBuild project referencing a buildspec.yml
aws codebuild create-project \
--name InnovateX-App-Build \
--source type=GITHUB,location=https://github.com/innovatex/app-repo.git \
--artifacts type=CODEPIPELINE \
--environment type=LINUX_CONTAINER,computeType=BUILD_GENERAL1_SMALL,image=aws/codebuild/standard:5.0 \
--service-role arn:aws:iam::123456789012:role/CodeBuildServiceRole
And add in CodePipeline JSON:
{
"name": "Build",
"actions": [{
"name": "CodeBuildAction",
"actionTypeId": {
"category": "Build",
"owner": "AWS",
"provider": "CodeBuild",
"version": "1"
},
"inputArtifacts": [{ "name": "SourceArtifact" }],
"runOrder": 1,
"configuration": {
"ProjectName": "InnovateX-App-Build"
}
}]
}
The Comparative Analysis #
| Option | API Complexity | Performance | Use Case |
|---|---|---|---|
| A | High (Code migration + setup) | Moderate | Overkill—unnecessary migration |
| B | Moderate (CodeBuild project setup) | High | Best for build and test integration |
| C | Low | Low | Deployment-focused, not for build/test |
| D | Moderate | Moderate | Conflates source and build stages |
| E | Moderate | High | Best practice: separate build stage |
Real-World Application (Practitioner Insight) #
Exam Rule #
“For the exam, always pick AWS CodeBuild to run build and test commands when CodePipeline uses GitHub source.”
Real World #
“In production, isolating build and test in a dedicated CodeBuild stage improves pipeline clarity and eases debugging. Trying to force builds inside CodeDeploy or source stages increases complexity and risk.”
(CTA) Stop Guessing, Start Mastering #
Disclaimer
This is a study note based on simulated scenarios for the AWS DVA-C02 exam.