AWS Certified DevOps Engineer – Professional (DOP-C02) — Question 369

A company is implementing a CI/CD pipeline for an application by using AWS CodePipeline and AWS CodeBuild. The company needs a solution to run unit tests and automatically generate code coverage reports before any code is deployed to production. The CI/CD pipeline execution must fail if the code coverage is less than 80%.

Which solution will meet these requirements?

Answer options

Correct answer: C

Explanation

AWS CodeBuild natively supports running test commands and generating code coverage reports via the buildspec.yml file. By configuring the buildspec.yml to fail the build when coverage is under 80%, CodePipeline will automatically stop the pipeline execution. Other solutions involving Lambda, Step Functions, or Jenkins introduce unnecessary complexity and operational overhead for a task that CodeBuild can handle natively.