AWS Certified Developer – Associate (DVA-C02) — Question 242

A developer is building a new application that will be deployed on AWS. The developer has created an AWS CodeCommit repository for the application. The developer has initialized a new project for the application by invoking the AWS Cloud Development Kit (AWS CDK) cdk init command.

The developer must write unit tests for the infrastructure as code (IaC) templates that the AWS CDK generates. The developer also must run a validation tool across all constructs in the CDK application to ensure that critical security configurations are activated.

Which combination of actions will meet these requirements with the LEAST development overhead? (Choose two.)

Answer options

Correct answer: B, E

Explanation

Option B is correct because the CDK assertions module is specifically designed for writing unit tests against CDK constructs, making it a straightforward solution. Option E is also correct as the CDK Aspects class allows for applying custom rules to the CDK application, ensuring compliance with security configurations. Options A, C, and D introduce unnecessary complexity or do not directly address the need for unit testing and validation of constructs.