Amazon EventBridge
Serverless event bus — routes events from AWS services, SaaS partners, and custom applications to targets using content-based filtering rules.
Overview
Amazon EventBridge is a serverless event bus that connects applications using events — it ingests events from AWS services, SaaS integrations, and custom sources, then routes them to targets based on rules with fine-grained content filtering.
EventBridge replaces the older CloudWatch Events service and extends it with schema discovery, third-party SaaS integration, and cross-account/cross-region event delivery.
Core Concepts
| Concept | Description |
|---|---|
| Event Bus | A channel that receives events; each account has a default bus plus custom buses |
| Event | A JSON object describing a state change (source, detail-type, detail, time, etc.) |
| Rule | Matches incoming events on a bus and routes them to one or more targets |
| Event Pattern | JSON pattern on a rule that filters events by source, detail-type, or detail fields |
| Schedule | A cron or rate expression that triggers a rule on a time-based schedule |
| Target | The destination that receives matched events (Lambda, SQS, Step Functions, etc.) |
| Schema Registry | Auto-discovered or manually registered event schemas for code generation |
| Pipe | Point-to-point integration: source → optional filter → optional enrichment → target |
| Archive | Stores events for replay; configurable retention period |
| Replay | Re-sends archived events to the event bus for reprocessing |
How EventBridge Works
Event Sources Event Bus Rules + Targets
┌──────────────┐
│ AWS Services │─────┐
│ (S3, EC2...) │ │
└──────────────┘ │ ┌─────────────┐ ┌──────────────────────┐
├────▶│ Event Bus │────▶│ Rule: pattern match │
┌──────────────┐ │ │ (default │ │ → Target: Lambda │
│ SaaS Partners│─────┤ │ or custom)│ │ → Target: SQS │
│ (Zendesk, │ │ └─────────────┘ │ → Target: Step Fn │
│ Datadog...) │ │ │ └──────────────────────┘
└──────────────┘ │ ▼
│ ┌─────────────┐
┌──────────────┐ │ │ Archive │────▶ Replay
│ Custom Apps │─────┘ └─────────────┘
│ (PutEvents) │
└──────────────┘Event Pattern Examples
Match EC2 instance state changes to "stopped":
{
"source": ["aws.ec2"],
"detail-type": ["EC2 Instance State-change Notification"],
"detail": {
"state": ["stopped"]
}
}Content-based filtering with prefix and numeric matching:
{
"source": ["custom.orders"],
"detail": {
"amount": [{ "numeric": [">", 1000] }],
"region": [{ "prefix": "us-" }]
}
}Supported Targets
| Target Category | Examples |
|---|---|
| Compute | Lambda, ECS task, Batch job, EC2 (via SSM Run Command) |
| Messaging | SQS, SNS, Kinesis Data Stream, Kinesis Data Firehose |
| Orchestration | Step Functions state machine, CodePipeline |
| API | API Gateway, API Destination (third-party HTTP endpoints) |
| Cross-account/region | Event bus in another account or region |
| Logging | CloudWatch Log Group |
EventBridge Pipes
Source (SQS, Kinesis, DynamoDB Stream, Kafka)
→ Filter (event pattern)
→ Enrichment (Lambda, Step Functions, API Gateway, API Destination)
→ Target (any supported target)Pipes provide a simpler point-to-point model without needing an event bus — useful for stream-to-target integrations with optional transformation.
EventBridge vs SNS vs SQS
| Criteria | EventBridge | SNS | SQS |
|---|---|---|---|
| Model | Event bus + content-based routing | Pub/sub fan-out | Queue (point-to-point) |
| Filtering | Rich JSON content filtering | Attribute-based filter policies | No native filtering |
| SaaS integration | Yes — built-in partner sources | No | No |
| Schema discovery | Yes | No | No |
| Archive and replay | Yes | No | No (DLQ for failed messages) |
| Throughput | Varies by region (soft limit) | Nearly unlimited | Nearly unlimited |
| Latency | Sub-second (slightly higher) | Sub-second | Sub-second |
Common Use Cases
- Event-driven microservices — Decouple producers and consumers using content-based routing rules on a shared event bus.
- SaaS integration — Ingest events from Zendesk, Auth0, Datadog, or Stripe directly into AWS workflows.
- Scheduled automation — Use cron/rate rules to trigger Lambda functions on a schedule (replaces CloudWatch Events schedules).
- Cross-account event routing — Forward events from application accounts to a central security or analytics account.
- Audit trail replay — Archive all events and replay a specific time window to reprocess or debug.
SAA/SAP Exam Tips
SAA Tip: "Route events based on content" or "filter events by detail fields" → EventBridge. SNS filter policies are simpler; EventBridge offers richer JSON-based matching.
SAA Tip: "Receive events from SaaS partners" → EventBridge partner event source. No other AWS messaging service has native SaaS integrations.
SAP Tip: EventBridge has a default throughput limit per region (can be raised). For very high-throughput streaming (millions of events/s), Kinesis Data Streams is more appropriate.
Cross-Cloud Equivalents
| Provider | Service / Solution | Notes |
|---|---|---|
| AWS | Amazon EventBridge | Baseline |
| Azure | Azure Event Grid | Event routing with filtering; similar model |
| GCP | Eventarc | Event routing for Cloud Run and Cloud Functions |
| On-Premises | Apache Kafka, RabbitMQ (with plugins), NATS | Requires custom routing logic |
Pricing Model
| Dimension | Unit | Notes |
|---|---|---|
| Custom events | Per million events | Published via PutEvents API |
| AWS/partner events | Free | AWS service events and partner events at no cost |
| Schema discovery | Free | Included at no additional charge |
| Archive + replay | Per GB archived | Replay events incur per-event charges |
| Pipes | Per million requests | Plus data processing per GB |
Related Services / See Also
- Amazon SQS and SNS — queue and pub/sub messaging for simpler patterns
- AWS Step Functions — orchestrate multi-step workflows triggered by EventBridge
- Amazon CloudWatch — EventBridge replaces CloudWatch Events (same underlying service)
- AWS Lambda — most common EventBridge target for serverless processing
Amazon API Gateway
Managed API front door — create, publish, and secure REST, HTTP, and WebSocket APIs at any scale with throttling, caching, and authorization.
Amazon SQS and SNS
Managed messaging — SQS for decoupled queue-based communication and SNS for pub/sub fan-out to multiple subscribers.