Explains how Amazon EventBridge routes detection events using JSON patterns to trigger scalable, cross-account automated remediation and orchestration with Lambda, Step Functions, and Systems Manager.
Welcome. This lesson explains how Amazon EventBridge turns detection (metrics, logs, traces) into automated operational responses. Detection tools like CloudWatch Metrics, CloudWatch Logs & Logs Insights, CloudWatch Alarms, Application Insights, and X-Ray surface issues — but detection alone doesn’t remediate them. EventBridge provides the central, serverless routing and orchestration layer to trigger, coordinate, and audit automated responses.
What EventBridge does
Acts as a serverless event bus that receives events from many sources.
Evaluates events against JSON-based rules (patterns).
Forwards matching events to one or more targets that perform actions or orchestrations.
Automatically scales, and retries failed deliveries (exponential backoff) for up to 24 hours.
Core flow:
Event source → Event bus → Rule (pattern matching) → Targets (actions)Event bus types
User-created buses for application or domain events
Isolate application events or create per-team buses
Partner
SaaS provider integrations
Ingest events directly from partners (Datadog, PagerDuty, etc.)
Pattern matching and filtering
EventBridge rules use JSON-based event patterns to match event fields such as source, detail-type, and nested detail attributes. Supported pattern operators include:
Exact string matches
Prefix matches
Numeric comparisons (>, <, >=, <=)
Field existence checks
Array membership checks
These operators enable precise routing so downstream automation only runs for relevant events — reducing noise and cost.When to use EventBridge vs SNS vs SQS
Purpose
Best choice
Why
Content-based routing across AWS, apps, and SaaS
EventBridge
Enables JSON pattern matching and rich filtering for many targets
Simple pub/sub fan-out and push notifications
SNS
Lightweight topic-based fan-out with simple filtering
Durable queuing, buffering, and pull consumers
SQS
Decouples producers/consumers and supports FIFO ordering
EventBridge is ideal for content-based routing and integrations across services and SaaS. Use SNS for simple topic-based fan-out and SQS for durable queueing and pull-based consumers.
Event sources and ingestion
EventBridge accepts events from:
This flexibility makes EventBridge a natural central hub for routing operational and application events.
Event patterns and operators — practical examples
You can express rules such as:
Match every EC2 state change where detail.state equals terminated.
Match Security Hub findings with severity.label equal to HIGH or CRITICAL.
Match resources whose name starts with prod- using a prefix match.
Example conceptual use cases
EC2 lifecycle: Detect an EC2 instance termination where the resource name begins with production and trigger lifecycle cleanup or replacement.
Security: Detect a Security Hub finding with severity HIGH/CRITICAL and failed compliance status, then initiate containment playbooks.
A single rule can match multiple related patterns and invoke the same remediation target, simplifying maintenance.Targets and integrations
EventBridge can invoke many target types:
AWS Lambda
Step Functions (recommended for orchestration)
Systems Manager (Run Command / Automation)
SNS and SQS
ECS tasks
CodePipeline / CodeBuild
Kinesis streams
Custom targets (via API destinations)
Common automated remediation flow:
CloudWatch Logs (pattern) → Metric Filter → CloudWatch Metric → CloudWatch Alarm → EventBridge rule → Target (Lambda / SSM / Step Functions) → Remediation + Audit LoggingStep Functions shines for multi-step remediations that require retries, error handling, branching logic, or human approvals. It centralizes orchestration and provides clear logging and state history.
Centralized cross-account routing
You can centralize events from multiple AWS accounts into one central event bus to apply consistent automation, simplify compliance, and reduce operational overhead. Cross-account routing requires configuring resource-based policies and granting source accounts permission to PutEvents to the central bus.
Common automation patterns
Pattern
Typical flow
Best for
Policy remediation
AWS Config → EventBridge → Systems Manager
Auto-fix drift and enforce policies
Security response
CloudTrail → EventBridge → Lambda → SNS
Fast containment, alerting, and audits
Lifecycle automation
EC2 state change → EventBridge → Step Functions
Complex lifecycle actions and orchestration
Scheduled jobs
Cron rule → EventBridge → Lambda/Step Functions
Periodic maintenance and compliance tasks
Select a pattern based on runtime requirements, conditional complexity, and whether human approval or multi-step orchestration is required. Use Systems Manager for OS-level runbooks and Step Functions when you need stateful orchestration.
Limits and operational considerations
Be mindful of these practical limits and design considerations:
Constraint
Notes / Mitigation
Rules per event bus (default soft limit: 300)
Request a quota increase if needed; aggregate patterns when possible
Targets per rule (limit: 5)
Use SNS, Step Functions, or fan-out patterns to reach more targets
Regionality
EventBridge is regional. For cross-region centralization, forward events (e.g., via Kinesis or cross-region EventBridge)
Retry behavior
Failed deliveries are retried with backoff for up to 24 hours
Best practices (summary)
Centralize events where consistent automation and auditing are needed; use resource policies for cross-account PutEvents.
Prefer EventBridge for content-based routing, especially when integrating multiple AWS services, partner SaaS, or custom apps.
Use Step Functions to orchestrate retries, approvals, and multi-step remediation with observable state.
Combine CloudWatch Logs → Metric Filters → Alarms → EventBridge as a reliable detection-to-action pipeline.
Plan for regionality and limits (rules, targets) during architectural design.
Summary
Amazon EventBridge is a serverless, managed event bus that bridges detection to action. Use it for content-based routing, partner and cross-account integrations, and centralized automated remediation. Combine EventBridge with Lambda, Systems Manager, and Step Functions to build resilient, auditable operational automation while accounting for limits, regions, and permissions.Further reading and references