exam questions

Exam AWS Certified Developer - Associate DVA-C02 All Questions

View all questions & answers for the AWS Certified Developer - Associate DVA-C02 exam

Exam AWS Certified Developer - Associate DVA-C02 topic 1 question 245 discussion

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.)

  • A. Use a unit testing framework to write custom unit tests against the cdk.out file that the AWS CDK generates. Run the unit tests in a continuous integration and continuous delivery (CI/CD) pipeline that is invoked after any commit to the repository.
  • B. Use the CDK assertions module to integrate unit tests with the application. Run the unit tests in a continuous integration and continuous delivery (CI/CD) pipeline that is invoked after any commit to the repository.
  • C. Use the CDK runtime context to set key-value pairs that must be present in the cdk.out file that the AWS CDK generates. Fail the stack synthesis if any violations are present.
  • D. Write a script that searches the application for specific key configuration strings. Configure the script to produce a report of any security violations.
  • E. Use the CDK Aspects class to create custom rules to apply to the CDK application. Fall the stack synthesis if any violations are present.
Show Suggested Answer Hide Answer
Suggested Answer: BE 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
65703c1
5 months ago
Selected Answer: BE
BE is the correct answer.
upvoted 1 times
...
SerialiDr
9 months ago
Selected Answer: BE
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.
upvoted 3 times
...
c9ebec2
10 months, 1 week ago
Selected Answer: BE
B: https://docs.aws.amazon.com/cdk/v2/guide/testing.html fine-grained assertions E: https://docs.aws.amazon.com/cdk/v2/guide/aspects.html
upvoted 3 times
...
TanTran04
10 months, 1 week ago
Selected Answer: BE
Option B: The standard approach to testing AWS CDK apps uses the AWS CDK's assertions module https://docs.aws.amazon.com/cdk/v2/guide/testing.html Option E: By using the CDK Aspects class to create custom rules, you can enforce specific conditions or checks on your CDK application, including security configurations. Failing the stack synthesis if any violations are present ensures that deployments do not proceed if critical security configurations are not met. CHATGPT 3.5
upvoted 1 times
...
deepak547
11 months ago
Option B allows writing unit tests for the infrastructure code using the built-in CDK assertions. Running them in a CI/CD pipeline on commits provides automated testing. Option E lets you define security validation rules as Aspects, which run on synth to catch issues early.
upvoted 1 times
...
Claire_KMT
12 months ago
B. Use the CDK assertions module to integrate unit tests with the application. Run the unit tests in a continuous integration and continuous delivery (CI/CD) pipeline that is invoked after any commit to the repository. E. Use the CDK Aspects class to create custom rules to apply to the CDK application. Fail the stack synthesis if any violations are present.
upvoted 3 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago