In the previous recipe, we learned how to check the automatically created CloudWatch metrics. We also learned some theory behind CloudWatch metrics. In this recipe, we will see how we can create a custom metric. We will create a simple functional scenario where we post a number of failed logins to the system. The sender may aggregate more requests within a set time, but we will not look at this in this recipe.
Your first custom metric (AWS CLI)
Getting ready
The following are the prerequisites for this recipe:
- A working AWS account.
- Access to AWS Management Console.
- You should have configured AWS CLI as discussed in the recipe Your First Lambda with AWS CLI in Chapter 1, Getting Started with Serverless Computing on AWS.