Routing Operational Events with EventBridge Rules
This lesson explains how Amazon EventBridge, a serverless event router and the backbone of most event-driven remediation on AWS, delivers matching events from event buses to targets.
Learning outcomes
After completing this lesson, you will be able to:
- Describe events and event buses.
- Write event patterns.
- Identify common AWS event sources for operations.
Events and event buses
An event is a JSON document with standard top-level fields: source (such as aws.ec2), detail-type (such as EC2 Instance State-change Notification), account, region, time, resources and a service-specific detail object. Every account has a default event bus in each Region that receives events from AWS services. Custom event buses receive events from your applications through PutEvents, and partner event buses receive events from SaaS providers. Buses have resource-based policies that control which accounts may send events to them.
Rules and event patterns
A rule on a bus has either an event pattern or a schedule (schedules on rules are a legacy option; EventBridge Scheduler is preferred). An event pattern matches an event when every field in the pattern matches. Values are arrays of allowed values, and content filters add prefix, suffix, anything-but, numeric ranges, exists and wildcard matching. Matching is exact and case-sensitive, so "state": ["Stopped"] never matches the EC2 value stopped. Each rule can have up to five targets.
{
"source": ["aws.ec2"],
"detail-type": ["EC2 Instance State-change Notification"],
"detail": {
"state": ["stopped", "terminated"],
"instance-id": [{"prefix": "i-0"}]
}
}The following diagram tests two patterns against the same EC2 event.

Does the pattern match?
Common AWS event sources for operations
Many operational automations start from a handful of AWS event sources. The following table lists the ones that appear most often in exam scenarios.
| Source | detail-type example | Typical automation |
|---|---|---|
| aws.ec2 | EC2 Instance State-change Notification | Notify or restart when an instance stops |
| aws.autoscaling | EC2 Instance-launch Lifecycle Action | Run configuration before an instance enters service |
| aws.cloudwatch | CloudWatch Alarm State Change | Start an Automation runbook from an alarm |
| aws.health | AWS Health Event | Notify about scheduled maintenance or service issues |
| aws.config | Config Rules Compliance Change | Remediate non-compliant resources |
| aws.s3 (EventBridge enabled on bucket) | Object Created | Process new files |
| Any service via CloudTrail | AWS API Call via CloudTrail | React to a specific API call |
| aws.trustedadvisor | Trusted Advisor Check Item Refresh Notification | Remediate a red check |
Which event source?
Restarting stopped production instances
Production instances tagged AlwaysOn=true must be restarted automatically if someone stops them. An EventBridge rule matches EC2 state changes to stopped. Because the event does not contain tags, the target is a Systems Manager Automation runbook that first reads the instance's tags with aws:executeAwsApi, branches with aws:branch if the tag is present, and then calls AWS-StartEC2Instance. An input transformer passes $.detail.instance-id to the runbook's InstanceId parameter, and the rule's IAM role allows ssm:StartAutomationExecution and iam:PassRole for the runbook's assume role.
How many targets can one rule have?
Show answer
Up to five.
Exam Tips
Remember for the exam
- AWS service events arrive on the default event bus in the Region where they happen.
- Event patterns are exact and case-sensitive; use content filters for prefixes and ranges.
- A rule can have up to five targets.
- Many events lack tags; look them up in the target if the logic depends on tags.