A developer is configuring the AppSpec file for an AWS CodeDeploy deployment to Amazon ECS. The developer wants to run a validation test before production traffic is routed to the newly deployed task set. Which lifecycle hook should the developer use in the AppSpec file?
- BeforeAllowTrafficCevap
- BApplicationStart
- CValidateService
- DApplicationStop
Cevap
BeforeAllowTraffic
The lifecycle hook designed for Amazon ECS deployments to run tasks before traffic shifts to the new task set is BeforeAllowTraffic. This hook allows developers to invoke a Lambda function to validate the new task set prior to routing live traffic.
Adım Adım Çözüm
Anahtar Kavram
AWS CodeDeploy AppSpec lifecycle hooks vary by compute platform. Amazon ECS deployments support BeforeAllowTraffic and AfterAllowTraffic to validate deployments before and after traffic shifting, while EC2 deployments support hooks like ApplicationStart and ValidateService.