The deployment team has recently deployed a new application on the Amazon EC2 instance launched in an Auto Scaling group.
The Operations Team is monitoring the Amazon EC2 instance using Amazon CloudWatch.
Team Lead wants to be notified only when multiple metrics are all in ALARM state.
For cost optimization, Auto scaling groups should scale in based upon CPU utilization. What alarm can be created to meet this requirement?
Click on the arrows to vote for the correct answer
A. B. C. D.Correct Answer: B.
A metric alarm watches a single CloudWatch metric which can be used to initiate actions on AWS resources or notify SNS topics.A composite alarm considers the state of multiple metric alarms or composite alarm states which it is part of before going into ALARM mode.
A composite alarm helps to reduce the number of notifications.
But it cannot initiate actions based upon the ALARM state.
Option A is incorrect as a composite alarm would be preferred to be used over a metric alarm to notify.
With Metric alarms, clients will get notifications for every alarm in an ALARM state.
Options C & D are incorrect as composite alarms can only notify SNS topics, it does not take action to initiate a scale-in action for Auto Scaling Group based upon CPU utilization.
For more information on alarms with Amazon CloudWatch, refer to the following URL,
https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Create_Composite_Alarm.htmlTo meet the requirement of notifying the Team Lead only when multiple metrics are in the ALARM state and scaling in the Auto Scaling group based on CPU utilization, we need to create a composite alarm.
A composite alarm is a combination of multiple metric alarms that have specified thresholds and evaluation periods. When all the individual metric alarms meet their thresholds within the specified evaluation period, the composite alarm goes into the ALARM state. In our case, we want to create a composite alarm that includes two metric alarms, one for CPU utilization and the other for another metric that the Operations Team is monitoring.
Here are the steps to create the composite alarm:
Create two metric alarms for the CPU utilization and the other metric that the Operations Team is monitoring separately. Set the threshold for the CPU utilization metric alarm to the desired value for scaling in. For example, if you want to scale in when the CPU utilization is below 30%, set the threshold to 30%. Set the threshold for the other metric alarm to the desired value for triggering an ALARM state.
Create a composite alarm and add the two metric alarms as its children. Set the operator for the composite alarm to "OR" because we want the composite alarm to go into the ALARM state when all its children are in the ALARM state.
Set the evaluation period for the composite alarm to the same value as the evaluation periods of the two metric alarms. For example, if the evaluation period for the metric alarms is 5 minutes, set the evaluation period for the composite alarm to 5 minutes as well.
Set the threshold for the composite alarm to "1" because we want the composite alarm to go into the ALARM state when all its children are in the ALARM state.
Set up an SNS topic to notify the Team Lead when the composite alarm goes into the ALARM state.
By creating a composite alarm with the above steps, we can ensure that the Team Lead is notified only when all the desired metrics are in the ALARM state, and the Auto Scaling group scales in based on CPU utilization, thereby optimizing costs.