nerdexam
Amazon

DOP-C02 · Question #449

A company is building a web application on AWS. The application uses AWS CodeConnections to access a Git repository. The company sets up a pipeline in AWS CodePipeline that automatically builds and de

The correct answer is A. Add an AWS CodeBuild action to the pipeline. Add a buildspec.yml file to the Git repository to. AWS CodePipeline supports multiple stages including source, build, test, and deploy. The most efficient way to integrate automated testing is by adding an AWS CodeBuild action to the pipeline that runs the tests using a buildspec.yml file. CodeBuild can be configured to fail the

Submitted by jian89· Mar 6, 2026SDLC Automation

Question

A company is building a web application on AWS. The application uses AWS CodeConnections to access a Git repository. The company sets up a pipeline in AWS CodePipeline that automatically builds and deploys the application to a staging environment when the company pushes code to the main branch. Bugs and integration issues sometimes occur in the main branch because there is no automated testing integrated into the pipeline. The company wants to automatically run tests when code merges occur in the Git repository and to prevent deployments from reaching the staging environment if any test fails. Tests can run up to 20 minutes. Which solution will meet these requirements?

Options

  • AAdd an AWS CodeBuild action to the pipeline. Add a buildspec.yml file to the Git repository to
  • BConfigure Git webhooks to initiate an AWS Lambda function during each code merge. Configure
  • CConfigure AWS Batch to use Docker images of test environments. Integrate AWS Batch into the
  • DConfigure the Git repository to push code to an Amazon S3 bucket during each code merge. Use

How the community answered

(31 responses)
  • A
    90% (28)
  • B
    3% (1)
  • D
    6% (2)

Explanation

AWS CodePipeline supports multiple stages including source, build, test, and deploy. The most efficient way to integrate automated testing is by adding an AWS CodeBuild action to the pipeline that runs the tests using a buildspec.yml file. CodeBuild can be configured to fail the pipeline automatically if tests fail, ensuring that deployments do not proceed to the staging environment. This pattern is directly supported and documented in AWS CodePipeline + CodeBuild CI/CD architecture guidance.

Topics

#CodePipeline#CodeBuild#Automated testing#CI/CD quality gates

Community Discussion

No community discussion yet for this question.

Full DOP-C02 Practice