Create Alarm

You can create a CloudWatch alarm that monitors CloudWatch metrics for a given AWS service. CloudWatch will automatically send you a notification when the metric reaches a threshold you specify.

In this section you will create an alarm that monitors the amount of traffic received by an EC2 instance and sends an email notification if a threshold is breached.

  1. In the CloudWatch console navigate to All alarms and click on Create alarm

    All Alarms

  2. Click Select metric

    Select Metric

  3. Click on EC2

    EC2 Metrics

  4. Click on Per-instance Metrics

    EC2 Metrics

  5. Enter NetworkIn in the search box and hit enter.

    Metric Search

  6. Select the checkbox for VPC B Private AZ1 Server and click Select metric

    Metric select

  7. In the resulting Specify metric and conditions screen change the Statistic and Period fields to Maximum and 1 minute respectively.

    Metric select

  8. In the Conditions section below, enter a threshold value of 1000000 and click Next

    Metric threshold

  9. In the Configure actions screen click on Add notification

    Add Notification

  10. Select Create new topic, enter NetworkingWorkshopAlarmTopic as the name, enter your email and click Create topic

    Add Notification

  11. Scroll to the bottom of the page, click Next and on the resulting screen

    • Enter NetworkingWorkshopAlarm as the Alarm name
    • Click Next

    Enter alarm name

  12. Review the values on the Preview and create screen and click Create alarm

    Preview and create

  13. The alarm will be created but the "State" of the alarm may show "Insufficient data". This will happen until enough data points are received by the alarm.

    Alarm Created

  14. Under Actions there will be a warning for "Pending confirmation" which means that you have not confirmed the email subscription to SNS yet.

    Alarm warning

  15. Go into your email, open the new message from "AWS Notifications" and confirm the subscription. This will be required to ensure you receive the notification.

    Confirm subscription

In the next section you will get the opportunity to trigger the alarm and test the notification that you configured.