Creating Alerts with CloudWatch Alarm
- Open the dashboard of CloudWatch
- Expand Alarms on the left side, press In alarm
- Press Create alarm

- Press Select metric

- Select the metric created in the previous step - UploadDocs_Lambda, then press env, then select staging

- Select Sum for Statistic

- Set the condition in the item condition
- Select Static for Threshold type
- Select Greater/Equal as the warning condition
- Enter 3 as the value of the alarm threshold
- Click Next

- Select Create new topic
- Enter the topic name:
CloudWatch_Alarms_Topic
- Enter the email you want to receive notifications for
- Click Create topic

- Scroll down, click Next
- Enter a name for the alert:
alarm-sum-fail-connections-to-dynamodb

- Scroll to the bottom and press Create alarm


- Open the email you subscribe to the topic to confirm the notification

- Back to API Gateway screen, click Send three times to call the API.
- Open email and check

- Back to the CloudWatch dashboard
- Click All alarms, then select the alarm you just created
- The histogram of the metric is displayed
