AWS CloudWatch API Guide – 2018
What you need to know about AWS Cloud Watch:-
AWS Cloud Watch is a monitoring tool offered by Amazon primarily to monitor other services like EC2, S3, RDS, etc. To work with Cloud Watch we first have to create instances using EC2.
The following ways are how you can monitor EC2 instances using Cloud Watch:-
(1) Check status of instance
Go to -> AWS dashboard -> EC2 -> select any instance -> click on monitoring (it will show you various aspects of that particular instance). It’s a basic monitoring we can see the monitoring metrics for every 5 minutes.
Cloud Watch monitor has several metrics like the one shown below:-
(2) View detail monitoring
Go to -> AWS dashboard -> EC2 -> select any instance -> detail monitoring.
We have to enable this detailed monitoring manually.
This is a chargeable service, unlike other free AWS services.
It will monitor the metrics every 1 minute. The only difference between monitoring and detail monitoring is that the former works every 5 minutes and the latter every 1 minute.
Cloud Watch Console:
Cloud watch console provides several metrics, such as EBS, EC2, EFS, RDS, and S3. I have specified some for you in the picture below:
(1) Metrics:
After selecting a particular metric we check the data and copy the URL link.
We can also get the data based on time period is I’ve shown in the picture below:
After selecting the metrics, you can set two types of alerts
2) Alarm: An alarm is set in before exceeding the threshold.
Alarm -> Create Alarm -> Select Metrics -> Select specific part -> Give Stranded name
The two types of action involved here are:-
a) Mail generated action
b) Terminate the particular instance when it reaches the time limit
c) Set billing Alerts:
Go to My account session -> Preferences -> Enable Receiving billing alerts
We will be able to get the billing alerts at alarm dashboard once we select the metric. You just have to create the alarm threshold with name, description and action.
In area description, you have to mention the threshold limit (for e.g. if billing is more than 5$).
Under “whenever: Cass Server Count” give value (e.g. 5$, same as threshold limit)
Actions:
(1) Under “Whenever this Alarm” select “State is alarm”
(2) Under ”Send notification to” select “Notify Me”
(3) Under “Email List” give your Mail Id.
Whenever threshold limit is reached (e.g. beyond 5$) you will be notified via email you configured.
The diagram below shows you the complete setup:
Mahesh J
Author
Hello all! I’m a nature’s child, who loves the wild, bringing technical knowledge to you restyled.