Question 161 · 548 in bank
Select 2A 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.)
Show answer
Answer: BE
Explanation
B. The AWS CDK assertions library provides a convenient way to write unit tests for CDK applications. It allows developers to assert various aspects of the CDK constructs, such as properties and resource counts. Integrating these unit tests into the CI/CD pipeline ensures that they are automatically run after any commit, providing continuous validation of the infrastructure code. E. Aspects in AWS CDK are a way to apply operations to all constructs in a CDK app or a part of the app. By using the Aspects class, the developer can create custom rules (like security configuration checks) and apply them across all constructs in the CDK application. If these rules find any violations, the stack synthesis can be set to fail, ensuring that the application adheres to critical security configurations.
Source: Adapted from community discussion — SerialiDr