
Ultimate access to all questions.
A company is automating its release pipeline using AWS CodePipeline and deploying applications to Amazon ECS with AWS CodeDeploy in a blue/green deployment model. They need to run test scripts on the new 'green' version of the application within 5 minutes before traffic is shifted. If any errors are detected during these tests, the deployment must be rolled back. Which strategy should be employed to meet these testing and rollback requirements?
A
Insert a stage in the CodePipeline between the source and deploy stages. Utilize AWS CodeBuild to establish a runtime environment and execute test scripts via build commands in the buildspec file. If errors are detected, halt the deployment using the aws deploy stop-deployment command.
B
Insert a stage in the CodePipeline between the source and deploy stages. Invoke an AWS Lambda function in this stage to execute the test scripts. If errors are detected, halt the deployment using the aws deploy stop-deployment command.
C
Include a hooks section in the CodeDeploy AppSpec file. Use the AfterAllowTestTraffic lifecycle event to trigger an AWS Lambda function that runs the test scripts. If errors are detected, terminate the Lambda function with an error code to initiate a rollback.
D
Include a hooks section in the CodeDeploy AppSpec file. Use the AfterAllowTraffic lifecycle event to trigger the test scripts. If errors are detected, halt the deployment using the aws deploy stop-deployment CLI command.