Creating Alerts with CloudWatch Alarm

  1. Open AWS CloudWatch console.

    • Click the In alarm on the left menu.
    • Click the Create alarm button. CreateAlarm
  2. At Step 1: Specify metric and conditions page.

    • Click the Select metric button. CreateAlarm
    • At Select metric popup.
      • Click the BooksList_Lambda at the Custom namespaces. CreateAlarm
      • Next, click the env. CreateAlarm
      • Check the staging.
      • Click the Select metric button. CreateAlarm
    • Choose the Sum at Statistic.
    • Choose the Static at Threshold type.
    • Choose the Greater/Equal at Whenever FailedConnectToDynamoDB is….
    • Enter 2 at than….
    • Click the Next button. CreateAlarm
  3. At Step 2: Configure actions page.

    • Choose the In alarm at Alarm state trigger.
    • Choose the Create new topic at Send a notification to the following SNS topic.
    • Enter fcj_cloudwatch_alarm_topic at Create a new topic….
    • Enter the email that you want to receive the notification.
    • Click the Create topic button. CreateAlarm
  4. Open the email that you chose to receive the notification before.

    • Click the Confirm subscription. CreateAlarm
    • Then you will receive the Subscription confirmed notification. CreateAlarm
  5. Back to Step 2: Configure actions page.

    • Scroll down to the bottom and click the Next button. CreateAlarm
  6. At Step 3: Add name and description page.

    • Enter fcj-fail-connect-to-dynamodb-alarm at Alarm name.
    • Click the Next button. CreateAlarm
  7. At Step 4: Preview and create page.

    • Click the Create alarm button. CreateAlarm
  8. Open AWS CloudWatch console.

    • Click the All alarms on the left menu.
    • You can see the fcj-fail-connect-to-dynamodb-alarm that we created in the previous step. CreateAlarm
  9. Open Postman to recall the api twice. CloudWatchMetrics

  10. Open the email that you chose to receive the notification before.

  11. Back to AWS CloudWatch console.

    • Click the All alarms on the left menu.
    • Choose the fcj-fail-connect-to-dynamodb-alarm at Name. CloudWatchMetrics
    • At fcj-fail-connect-to-dynamodb-alarm page, you can see the histogram of the metric is displayed. CloudWatchMetrics