DVA-C02 - Deployment (24% of the exam) - Section 3.6

Automate build, test and deployment using AWS CodePipeline and AWS CodeBuild with commit-triggered actions and manual approvals.

Automate build, test, and deployment workflows with AWS CodePipeline orchestrating stages that invoke AWS CodeBuild using a buildspec file. Insert manual approval actions between stages to gate production deployments and configure pipeline transitions to halt or resume flow based on test outcomes.

AWS CodePipelineAWS CodeBuildManual approval actionsbuildspec

Practice question for this objective

Free sampleDeploymentmedium

A development team uses AWS CodeBuild to compile a Node.js service and run its unit tests. The team wants the dependency install to happen first, the unit tests to run only after a successful install, and the compiled output to be packaged for the next pipeline stage. In which sequence of buildspec phases should the team place these commands so CodeBuild runs them in the intended order?

  • APut the dependency install in the build phase, run the unit tests in the install phase, and package the output in the pre_build phase of the buildspec file.
  • BPut the dependency install in the install phase, run the unit tests in the build phase, and package the compiled output in the post_build phase of the buildspec file. Correct
  • CPut the dependency install in the post_build phase, run the unit tests in the pre_build phase, and package the compiled output in the install phase of the buildspec file.
  • DPut all three commands in a single pre_build phase and rely on CodeBuild to reorder them by dependency so install, tests, and packaging each run correctly.
Map build steps to the fixed CodeBuild buildspec phase order of install, pre_build, build, and post_build to control execution sequence. CodeBuild always runs buildspec phases in the order install, pre_build, build, then post_build, and within each phase commands run top to bottom; placing install, tests, and packaging in successive phases enforces the ordering rather than relying on any automatic dependency resolution.

Why A is wrong: This inverts the phase order, because install runs before pre_build and build, so placing tests in install would run them before dependencies are even fetched.

Why B is correct: CodeBuild executes install, then pre_build, then build, then post_build in that fixed order, so this mapping runs the steps exactly as the team intends.

Why C is wrong: This is tempting if phase names are read loosely, but post_build runs last, so installing dependencies there would happen after tests had already failed.

Why D is wrong: CodeBuild runs commands in the literal order written and does not reorder them by dependency, so collapsing every step into one phase gives no guaranteed sequencing.

See more DVA-C02 practice questions, answers explained.

Exam traps in Deployment

Answers that look right on this material and are not. Each one is a distractor from a different question in the DVA-C02 bank for this domain.

  • Set a timeout of zero seconds on the approval action so the pipeline blocks forever until a decision is made.

    Why it is wrong: Tempting because it sounds like infinite wait, but a manual approval already waits up to seven days by default and there is no zero-second-equals-forever setting; this is an invented configuration.

  • Have the CodeBuild action clone the source repository directly at build time using credentials in the build role, bypassing whatever the source action produced.

    Why it is wrong: Cloning directly bypasses the pipeline artifact flow and can build a different commit than the one that triggered the run, breaking the link between source and build.

  • An artifacts section listing the JUnit XML file so CodeBuild stores it as the build output and the test reports view reads the results from that stored artifact.

    Why it is wrong: The artifacts section only stores files as build output for later stages; it does not parse test results into the CodeBuild test reports view.

Examworthy is not affiliated with or endorsed by Amazon Web Services. Original, blueprint-aligned practice material only.