Key Aspects of AWS CloudWatch Alarms
CloudWatch alarms are essential for monitoring AWS resources and applications. They trigger notifications based on metrics, allowing for automated responses to changes in your AWS environment.
Alarm States
- OK: The alarm condition has not been met.
- INSUFFICIENT\_DATA: There is not enough data to determine the alarm state.
- ALARM: The defined threshold has been breached, triggering a notification.
Alarm Period
- The period defines the duration CloudWatch evaluates the metric before deciding the alarm state. This period can range from very short (e.g., 10 seconds) to long durations, applicable to both standard and high-resolution custom metrics.
Main Targets of Alarms
- EC2 Actions: Perform actions on EC2 instances such as stop, terminate, reboot, or recover.
- Auto-Scaling: Trigger scaling actions (scale out or in) based on alarms.
- Notifications: Send notifications via SNS, which can be connected to Lambda functions for custom actions.
Composite Alarms
- Composite alarms monitor multiple metrics by aggregating the states of several other alarms, allowing for complex condition checks using AND/OR operations. This reduces alarm noise by enabling more specific conditions for alerts.

Example
- Alarm-A monitors the CPU usage of an EC2 instance.
- Alarm-B monitors the IOPS.
- A Composite Alarm is defined to trigger when both Alarm-A and Alarm-B are in the ALARM state, enabling nuanced monitoring strategies.
EC2 Instance Recovery