Adding Deployment Alerts

Here, you'll set up alerts for some metrics using CloudWatch for your application!

We'll cover the following

CloudWatch #

So far, you haven’t set up any tests o compare the old and new versions. You could manually try things out during the deployment and then roll back in case of problems from the CodeDeploy Web Console, but that’s not really efficient or sustainable. It would be better if CodeDeploy did this automatically.

Luckily, CloudWatch can look out for errors automatically. You used CloudWatch to access logs in the previous chapter, but you can also use it to inspect and monitor operational statistics about your application. CloudWatch automatically tracks lots of interesting information about AWS Lambda and API Gateway, such as latency, number of invocations, and number of errors. Here is how you can see this information:

  1. Go to the AWS Web Console,, and sign in if necessary.
  2. Select CloudWatch in the list of services.
  3. Select Metrics in the left-hand menu.
  4. In the list of metric namespaces, select Lambda then By Function name, and select check boxes next to errors and invocations for your function.

Get hands-on with 1200+ tech skills courses.