So now we have all the tools to minimize the impact of possible bugs or failures. However, we can also avoid invoking a function version that contained errors by running the CodeDeploy hooks first. Hooks are Lambda functions triggered by CodeDeploy before and after traffic shifting takes place. It expects to get notified about the success or failure of the hooks, only continuing to the next step if they succeed. They are good for running integration tests and checking that everything fits together in the cloud, since it will automatically rollback at a failure.
Let's have look at how to create hooks by going through the following steps:
- Let's update the serverless.yml to add hook details. We need to grant our ...