1 Answer
- Newest
- Most votes
- Most comments
1
Another option is to add an AfterAllowTraffic
lifecycle hook to your application's AppSpec file. This hook will be called once traffic begins to flow in to your canary tasks. You can use whatever custom logic you like in the Lambda function. To complete the lifecycle hook, your Lambda function (or its delegate) must invoke CodeDeploy's PutLifecycleEventHookExecutionStatus API action with success or failure.
You can find a tutorial on this here and a lifecycle hook reference here.
Relevant content
- asked 4 months ago
- asked 5 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
- Why did my CloudWatch canary fail with the error "Node is either not visible or not an HTMLElement"?AWS OFFICIALUpdated 5 months ago
Thanks for your thoughts Michael, I will have a look at this! Just so that I'll be able to give your idea a little more context: What would you consider the "aws idiomatic" way, and what approach would you recommend in general? Would you say that plugging a lambda into the
AfterAllowTraffic
hook or use an Alarm Configuration in the Deployment Group is the better way to handle this? Thanks.The answer, as with most things, is "it depends." It's going to come down to a judgment call you must make that is informed by the needs of your business and the specific application. If your deployment health can be expressed exclusively in terms of CloudWatch metrics, then using a metric based alarm could work. Otherwise, if you think it would be more useful to express your health evaluation logic in code, then a Lambda function will work better.