Match an alarm state change
How to configure and troubleshoot rules that match AWS service events, including CloudWatch alarm state changes, transform target input, and deliver events reliably to targets. · associate
An EventBridge rule matches an event pattern on one event bus and sends matching events to configured targets. AWS service events normally arrive on the default event bus in the Region where they occur. CloudWatch sends state-change events for metric and composite alarms; these are changes of state, not repeated reminders while an alarm stays in ALARM.
For an ALARM-only rule, use {"source":["aws.cloudwatch"],"detail-type":["CloudWatch Alarm State Change"],"detail":{"state":{"value":["ALARM"]}}}. The named fields must all match. Values within a field's array are alternatives, and ordinary string matches are case-sensitive. Omitted fields do not restrict matching; add detail.alarmName or resources to narrow the rule to a particular alarm.
This architecture invokes a Lambda function through EventBridge rather than through a direct alarm action. Direct alarm actions and EventBridge targets are separate configurations. Composite alarms cannot directly perform EC2 or Auto Scaling actions; routing their state changes through EventBridge lets a target implement an appropriate response.
1 / 5 CloudWatch emits an event when the alarm changes state. The event includes the alarm name and the new state.
AWS architecture icons are the property of Amazon Web Services. BlowStack is not affiliated with or endorsed by AWS.