Topic 1 Question 34
A company is using AWS CodePipeline to automate its release pipeline. AWS CodeDeploy is being used in the pipeline to deploy an application to Amazon Elastic Container Service (Amazon ECS) using the blue/green deployment model. The company wants to implement scripts to test the green version of the application before shifting traffic. These scripts will complete in 5 minutes or less. If errors are discovered during these tests, the application must be rolled back. Which strategy will meet these requirements?
Add a stage to the CodePipeline pipeline between the source and deploy stages. Use AWS CodeBuild to create a runtime environment and build commands in the buildspec file to invoke test scripts. If errors are found, use the aws deploy stop-deployment command to stop the deployment.
Add a stage to the CodePipeline pipeline between the source and deploy stages. Use this stage to invoke an AWS Lambda function that will run the test scripts. If errors are found, use the aws deploy stop-deployment command to stop the deployment.
Add a hooks section to the CodeDeploy AppSpec file. Use the AfterAllowTestTraffic lifecycle event to invoke an AWS Lambda function to run the test scripts. If errors are found, exit the Lambda function with an error to initiate rollback.
Add a hooks section to the CodeDeploy AppSpec file. Use the AfterAllowTraffic lifecycle event to invoke the test scripts. If errors are found, use the aws deploy stop-deployment CLI command to stop the deployment.
ユーザの投票
コメント(4)
- 正解だと思う選択肢: C
C is the correct answer
👍 1alce20202023/04/14 - 正解だと思う選択肢: C
Lifecycle event hooks for an Amazon ECS deployment:
AfterAllowTraffic – Use to run tasks after the second target group serves traffic to the replacement task set. The results of a hook function at this lifecycle event can trigger a rollback.
👍 1ele2023/04/15 - 正解だと思う選択肢: C
The correct solution to meet these requirements is option C.
Explanation:
In this scenario, the requirement is to add scripts to test the green version of the application before shifting traffic. These scripts should be executed quickly and, in case of errors, the application must be rolled back. To achieve this, we can use the following steps:
👍 1haazybanj2023/05/01
シャッフルモード