CloudWatch Alarms and Composite Alarms
Set threshold-based alarms to trigger Auto Scaling or SNS notifications, and combine multiple alarms into a composite alarm to reduce alert noise.
What Is a CloudWatch Alarm?
A CloudWatch alarm monitors a single metric or the result of a metric math expression over a time period you specify. When the metric crosses a threshold you define, the alarm changes state and can automatically trigger an action such as sending an SNS notification, scaling an Auto Scaling group, stopping an EC2 instance, or executing a Systems Manager OpsItem. Alarms are the primary mechanism for automated operational response in AWS.
Alarm States
A CloudWatch alarm is always in one of three states: OK — the metric is within the defined threshold; ALARM — the metric has breached the threshold for the required number of evaluation periods; INSUFFICIENT_DATA — the alarm has just been created, the metric is not available, or not enough data has been collected yet. Transitions between states trigger actions configured for that state change — you can have different SNS topics for OK, ALARM, and INSUFFICIENT_DATA states.
# View all alarms and their current state
aws cloudwatch describe-alarms \
--query 'MetricAlarms[].{Name:AlarmName,State:StateValue,Metric:MetricName}' \
--output table
# List only alarms currently in ALARM state
aws cloudwatch describe-alarms \
--state-value ALARM \
--query 'MetricAlarms[].AlarmName'All lessons in this course
- CloudWatch Metrics, Namespaces, and Dimensions
- CloudWatch Alarms and Composite Alarms
- CloudWatch Logs and Log Insights
- CloudWatch Dashboards and Container Insights