A developer is configuring a blue/green deployment for an Amazon ECS service using AWS CodeDeploy. The deployment must meet the following requirements:
- Provide zero downtime for users during updates.
- Run automated integration tests to validate the replacement task set (Green) using a test port before any production traffic is shifted.
- Automatically and immediately roll back the deployment if the validation tests fail, or if a CloudWatch alarm for HTTP 5xx errors is triggered.
- Shift 10% of the production traffic to the new version initially, and shift the remaining 90% after a 15-minute soak period.
Which two configurations or lifecycle hooks should the developer use to meet these requirements? (Select TWO.)
- Use the AfterAllowTestTraffic lifecycle hook in the AppSpec file to invoke an AWS Lambda function that runs the validation tests.Cevap
- Select the CodeDeployDefault.ECSCanary10Percent15Minutes deployment configuration for the deployment group.Cevap
- CUse the ApplicationStart lifecycle hook in the AppSpec file to run the validation tests.
- DSelect the CodeDeployDefault.ECSLinear10PercentEvery1Minute deployment configuration for the deployment group.
- ESpecify a shell script path under the BeforeAllowTraffic hook in the AppSpec file to run validation commands directly on the replacement container instances.
Cevap
Use the AfterAllowTestTraffic lifecycle hook in the AppSpec file to invoke a Lambda function that runs the validation tests, and select the CodeDeployDefault.ECSCanary10Percent15Minutes deployment configuration for the deployment group.
The correct configurations are the AfterAllowTestTraffic lifecycle hook (which runs validation tests against the replacement task set while it is accessible via the test listener) and the CodeDeployDefault.ECSCanary10Percent15Minutes deployment configuration (which routes 10% of traffic to the green deployment and the remaining 90% after 15 minutes).
Adım Adım Çözüm
Anahtar Kavram
Deploying updates to Amazon ECS using AWS CodeDeploy blue/green traffic shifting and lifecycle hooks.