Subscribe to Our Weekly Newsletter
Creating an Amazon CloudWatch Alarm
Creating an Amazon CloudWatch Alarm
The following steps will instruct you on how to create an Amazon CloudWatch Alarm:
1) Firstly, you are required to select a metric for your alarm. To do so:
- You need to open the Amazon CloudWatch console at https://console.aws.amazon.com/cloudwatch/.
- Now, in the “Navigation” pane, you should select “US East (Virginia)” from the “Region” drop-down menu.
- Click on “Create a New Alarm”.
- On the “SELECT METRIC” page of the “Create Alarm Wizard”, you need to select “EC2: Aggregated by Auto Scaling Group” from the “Viewing” drop-down menu.
- Now, you are required to click on the “MyAutoScalingGroup/CPU Utilization” row.
- Click on the “Continue” button.
The “DEFINE ALARM” page of the “Create Alarm Wizard” will appear.
2) In this next step you will need to define the alarm.
- On the “DEFINE ALARM” page of the “Create Alarm Wizard”, type “MyHighCPUAlarm” (without the quotes) in the “Name” box.
- Now, you are required to type a description in the “Description” box.
- In the “Define Alarm Threshold” section, you should select > and type 60 in the first box, and 10 in the minutes box (for this example). For your own application, you should do some load testing to determine what value is the best for your application.
- Click on the “Continue” button.
The “CONFIGURE ACTIONS” page of the “Create Alarm Wizard” will appear.
3) Now you will be required to define your actions. To do so:
- On the “CONFIGURE ACTIONS” page of the “Create Alarm Wizard”, you will need to select “ALARM” from the “When alarm state is” drop-down menu.
- Now, select “Auto Scaling Policy” from the “Take Action” drop-down menu.
- You will then be required to select “MyAutoScalingGroup” from the “Auto Scaling Group” drop-down menu.
- The next step is to select “MyScaleUpPolicy (Add 1 instance)” from the “Policy” drop-down menu.
- Click on the “Add Action” button.
- Select “ALARM” from the “When alarm state is” drop-down menu.
- Select “Send Notification” from the “Take Action” drop-down menu.
- Now, you will need to type a topic name in the “Topic” box, and an email address in the “Email(s)” box.
- Click on the “Add Action” button.
- Click on the “Continue” button.
The “REVIEW” page of the “Create Alarm Wizard” will appear.
4) Click on the “Create Alarm” button.
A confirmation window will appear.
5) Click on the “Close” button.
The confirmation window will close, and you will be returned to the CloudWatch page. Your new alarm will now appear on the list. While creating your MyScaleDownPolicy, you can create another alarm using the same procedure.