Topic 1 Question 273
2 つ選択A company uses the AWS Cloud Development Kit (AWS CDK) to define its application. The company uses a pipeline that consists of AWS CodePipeline and AWS CodeBuild to deploy the CDK application.
The company wants to introduce unit tests to the pipeline to test various infrastructure components. The company wants to ensure that a deployment proceeds if no unit tests result in a failure.
Which combination of steps will enforce the testing requirement in the pipeline?
Update the CodeBuild build phase commands to run the tests then to deploy the application. Set the OnFailure phase property to ABORT.
Update the CodeBuild build phase commands to run the tests then to deploy the application. Add the --rollback true flag to the cdk deploy command.
Update the CodeBuild build phase commands to run the tests then to deploy the application. Add the --require-approval any-change flag to the cdk deploy command.
Create a test that uses the AWS CDK assertions module. Use the template.hasResourceProperties assertion to test that resources have the expected properties.
Create a test that uses the cdk diff command. Configure the test to fail if any resources have changed.
ユーザの投票
コメント(3)
- 正解だと思う選択肢: AD
A. This step is crucial because:
It integrates the unit tests into the build phase of CodeBuild. By setting the OnFailure property to ABORT, it ensures that the pipeline stops if any tests fail, preventing deployment of potentially faulty infrastructure. If all tests pass, the deployment will proceed as normal.
D. This step is important because:
It utilizes the AWS CDK assertions module, which is specifically designed for testing CDK applications. The template.hasResourceProperties assertion allows you to verify that the resources defined in your CDK code have the expected properties. This type of test can catch issues in your infrastructure definition before deployment.
👍 3TEC12024/07/10 - 正解だと思う選択肢: AD
I'm not sure but A D seems right
👍 3trungtd2024/07/14 - 正解だと思う選択肢: AD
Option A: <OnFailure phase>
- This option involves configuring the build phase in CodeBuild to run tests before deployment. Setting the OnFailure phase property to ABORT ensures that if any test fails, the build process is stopped, and the deployment doesn't proceed.
- This ensures that the build and deployment process only proceeds if the tests are successful, which is crucial for maintaining application integrity.
Option D: <CDK assertions>
- This option involves writing unit tests using the AWS CDK assertions module. The template.hasResourceProperties assertion checks if CloudFormation templates have resources with expected properties, ensuring the infrastructure's logical correctness.
- This enforces unit testing by checking that the CloudFormation templates have the expected properties, ensuring the application’s infrastructure is as intended.
👍 3jamesf2024/08/06
シャッフルモード