nerdexam
Amazon

DVA-C02 · Question #670

A company wants to use AWS CodeDeploy to deploy several AWS Lambda functions to a pipeline in AWS CodePipeline. The company needs to add unit tests to the pipeline for the Lambda function code. The…

The correct answer is B. Add the unit tests to run in an AWS CodeBuild project as a test stage in the CodePipeline. Adding the unit tests in an AWS CodeBuild project as a separate test stage within the CodePipeline allows the tests to run before the deployment stage. If the tests fail, the pipeline automatically stops, preventing deployment. This approach aligns with best practices for…

Submitted by ashley.k· Mar 5, 2026Deployment

Question

A company wants to use AWS CodeDeploy to deploy several AWS Lambda functions to a pipeline in AWS CodePipeline. The company needs to add unit tests to the pipeline for the Lambda function code. The unit tests must pass before deployment. Which solution will meet these requirements?

Options

  • AAdd the unit tests to the CodeDeploy BeforeAllowTraffic hook. Configure the pipeline to stop
  • BAdd the unit tests to run in an AWS CodeBuild project as a test stage in the CodePipeline
  • CAdd the unit tests to the CodeDeploy BeforeInstall hook. Configure the pipeline to stop running if
  • DAdd the unit tests to the reports section of AWS CodeBuild. Configure the pipeline to stop running

How the community answered

(34 responses)
  • A
    6% (2)
  • B
    82% (28)
  • C
    9% (3)
  • D
    3% (1)

Explanation

Adding the unit tests in an AWS CodeBuild project as a separate test stage within the CodePipeline allows the tests to run before the deployment stage. If the tests fail, the pipeline automatically stops, preventing deployment. This approach aligns with best practices for continuous integration and deployment pipelines by separating build, test, and deploy phases

Community Discussion

No community discussion yet for this question.

Full DVA-C02 Practice