nerdexam
Amazon

DOP-C02 · Question #288

A company uses the AWS Cloud Development Kit (AWS CDK) to define its application. The company uses a pipeline that consists of AWS CodePipeline and AWS CodeBuild to deploy the CDK application. The com

The correct answer is A. Update the CodeBuild build phase commands to run the tests then to deploy the application. Set D. Create a test that uses the AWS CDK assertions module. Use the. To validate AWS CDK-defined infrastructure, use CDK Assertions (assertions module) to test synthesized CloudFormation templates (e.g., template.hasResourceProperties). Integrate testing into CodeBuild buildspec before deployment, setting OnFailure: ABORT so the pipeline halts if

Submitted by minji_kr· Mar 6, 2026SDLC Automation

Question

A company uses the AWS Cloud Development Kit (AWS CDK) to define its application. The company uses a pipeline that consists of AWS CodePipeline and AWS CodeBuild to deploy the CDK application. The company wants to introduce unit tests to the pipeline to test various infrastructure components. The company wants to ensure that a deployment proceeds if no unit tests result in a failure. Which combination of steps will enforce the testing requirement in the pipeline? (Choose two.)

Options

  • AUpdate the CodeBuild build phase commands to run the tests then to deploy the application. Set
  • BUpdate the CodeBuild build phase commands to run the tests then to deploy the application. Add
  • CUpdate the CodeBuild build phase commands to run the tests then to deploy the application. Add
  • DCreate a test that uses the AWS CDK assertions module. Use the
  • ECreate a test that uses the cdk diff command. Configure the test to fail if any resources have

How the community answered

(46 responses)
  • A
    83% (38)
  • B
    2% (1)
  • C
    11% (5)
  • E
    4% (2)

Explanation

To validate AWS CDK-defined infrastructure, use CDK Assertions (assertions module) to test synthesized CloudFormation templates (e.g., template.hasResourceProperties). Integrate testing into CodeBuild buildspec before deployment, setting OnFailure: ABORT so the pipeline halts if tests fail. This ensures safe continuous delivery following AWS CDK testing best practices.

Topics

#AWS CDK#CodePipeline#CodeBuild#infrastructure testing

Community Discussion

No community discussion yet for this question.

Full DOP-C02 Practice