An organization is transitioning their microservices to Amazon ECS and plans to use AWS CodeDeploy for automated blue/green deployments. To ensure zero downtime, the deployment workflow must execute validation tests against the replacement task set on a secondary port before shifting any production traffic. Furthermore, AWS CodeDeploy must be authorized to interact with the ECS cluster and load balancer during the deployment execution.
Which TWO configuration actions should the developer perform to support this deployment flow?
- Define the validation test under the AfterAllowTestTraffic lifecycle hook in the AppSpec file to trigger a validation AWS Lambda function.Cevap
- Configure a trust policy on the CodeDeploy service role that allows the codedeploy.amazonaws.com service principal to perform the sts:AssumeRole action.Cevap
- CDefine the validation test under the BeforeAllowTraffic lifecycle hook in the AppSpec file to execute a shell script that runs integration tests directly on the container.
- DDefine the validation test under the AfterAllowTraffic lifecycle hook in the AppSpec file to verify the health of the replacement task set.
- EConfigure the trust policy on the Amazon ECS task execution role to trust the codedeploy.amazonaws.com service principal.
Cevap
To support this deployment flow, the developer must configure the validation tests under the AfterAllowTestTraffic lifecycle hook in the AppSpec file to trigger a validation AWS Lambda function, and configure a trust policy on the CodeDeploy service role to allow the codedeploy.amazonaws.com service principal to perform the sts:AssumeRole action.
To run validation tests on a test listener before production traffic shifts, the AfterAllowTestTraffic hook must be used to trigger a validation Lambda function. Additionally, CodeDeploy requires a service role with a trust policy that allows codedeploy.amazonaws.com to assume the role via sts:AssumeRole so it has the permissions to execute the deployment.
Adım Adım Çözüm
Anahtar Kavram
AWS CodeDeploy ECS Deployment Validation and IAM Authorization