AWS Certified Developer – Associate — Question 317

A security review for a software company’s application infrastructure shows that there is no test coverage in any of the company’s deployment pipelines. A developer must fix this issue as soon as possible. The company has been integrating the AWS Cloud Development Kit (AWS CDK) into the deployment process. However, much of the pipeline still uses AWS CloudFormation templates. The developer needs to add test coverage to all the deployment code.

Which solution will meet these requirements with the LEAST amount of configuration?

Answer options

Correct answer: B

Explanation

The AWS CDK assertions module provides a unified way to test both CDK-synthesized templates and raw CloudFormation templates with minimal setup. By using Template.fromString(), developers can easily ingest and assert against existing legacy CloudFormation templates, while Template.fromStack() allows testing of CDK stacks directly. This avoids the overhead of converting code formats using constructs like CfnInclude, making it the most efficient solution.