Alerting & Automated Actions
CloudWatch alarms watch a single metric over a time period you specify, and perform one or more actions based on the value of the metric relative to a given threshold over a number of time periods. The action is a notification sent to an Amazon SNS topic or an Amazon EC2 Auto Scaling policy.
Watches a single metric over a specified time period.
Triggers when the metric breaches a defined threshold.
Initiates automated actions like notifications or scaling.
An alarm has three possible states:
The metric is within the defined threshold.
The metric has breached the threshold for the specified number of evaluation periods.
Not enough data is available for the metric to determine the alarm state.
Configuring an alarm involves specifying the metric to watch and the conditions that trigger the alarm.
The metric to monitor, including its Namespace, MetricName, and any Dimensions.
The metric statistic to apply (e.g., Average, Minimum, Maximum, Sum).
The length of time to evaluate the metric, in seconds.
The number of most recent periods to evaluate when determining alarm state.
The number of datapoints within the evaluation periods that must be breaching to cause the alarm to trigger.
The value to compare the metric against.
The arithmetic operation to use for comparison (e.g., >=, >, <, <=).
How to treat missing datapoints (e.g., `breaching`, `notBreaching`, `ignore`, `missing`).
You can configure alarms to trigger a variety of automated actions when they change state.
Send a notification to an SNS topic. This can then be routed to email, SMS, Lambda, or an HTTP endpoint.
Trigger an EC2 Auto Scaling policy to scale your fleet in or out in response to changing demand.
Stop, terminate, or reboot an EC2 instance. This is useful for automated recovery from instance failures.
Composite alarms allow you to combine multiple alarms using Boolean logic (AND, OR, NOT) to create more sophisticated alerting rules. This helps in reducing alarm noise by only triggering when multiple conditions are met.
ALARM(HighCPUAlarm) AND ALARM(HighMemoryAlarm)