A developer is configuring an AWS CodeDeploy deployment group to perform a blue/green deployment for an Amazon ECS service. The developer wants to run validation tests against the replacement task set using a test listener before routing production traffic. The deployment fails during the validation phase. Upon reviewing the logs, the developer discovers that the AppSpec file specifies an invalid lifecycle hook for the ECS compute platform, and CodeDeploy is unable to invoke the validation Lambda function due to incorrect IAM permissions. Which combination of configurations will correctly resolve these issues?
- Change the AppSpec lifecycle hook to AfterAllowTestTraffic and ensure that the CodeDeploy service role is granted lambda:InvokeFunction permissions.Cevap
- BChange the AppSpec lifecycle hook to ValidateService and ensure that the CodeDeploy service role is granted lambda:InvokeFunction permissions.
- CChange the AppSpec lifecycle hook to AfterAllowTestTraffic and add codedeploy.amazonaws.com to the trust policy of the validation Lambda function's IAM execution role.
- DChange the AppSpec lifecycle hook to AfterAllowTestTraffic and store the Lambda function's database credentials in AWS Systems Manager Parameter Store with automatic rotation enabled.
Cevap
Change the AppSpec lifecycle hook to AfterAllowTestTraffic and ensure that the CodeDeploy service role is granted lambda:InvokeFunction permissions.
The correct option is the one that changes the AppSpec lifecycle hook to AfterAllowTestTraffic and ensures that the CodeDeploy service role is granted lambda:InvokeFunction permissions. In an Amazon ECS blue/green deployment, the AfterAllowTestTraffic hook runs validation tests after test traffic is routed to the replacement task set. Additionally, the CodeDeploy service role requires permission to invoke the validation Lambda function.
Adım Adım Çözüm
Anahtar Kavram
AWS CodeDeploy ECS blue/green deployment lifecycle hooks and IAM permissions