Amazon EventBridge
Serverless event bus for building event-driven architectures and integrating applications
What is EventBridge?
Amazon EventBridge is a serverless event bus that makes it easy to connect applications together using data from your own apps, integrated Software-as-a-Service (SaaS) applications, and other AWS services. EventBridge enables you to build event-driven architectures by routing events between services, applications, and systems in real-time.
π‘ Key Innovation: EventBridge provides a centralized, scalable event routing system that eliminates the need for point-to-point integrations, enabling loose coupling between services.
Event delivery
No infrastructure
Millions of events
Pay per event
Core Components
EventBridge consists of several key components that work together to create a comprehensive event-driven architecture.
π Event Bus
Central router that receives events
Default, custom, and partner event buses
π Events
JSON objects with event data
Schema registry and discovery
π― Rules
Filter and route events
Event patterns and content filtering
πͺ Targets
Destinations for matched events
Lambda, SQS, SNS, Step Functions, and more
π Schemas
Event structure definitions
Code generation and validation
Event Sources
βοΈ AWS Services
Over 200 AWS services emit events to EventBridge by default, including EC2, S3, Lambda, RDS, and more.
{
"version": "0",
"id": "12345678-1234-1234-1234-123456789012",
"detail-type": "EC2 Instance State-change Notification",
"source": "aws.ec2",
"account": "123456789012",
"time": "2024-01-20T10:30:00Z",
"region": "us-east-1",
"resources": ["arn:aws:ec2:us-east-1:123456789012:instance/i-1234567890abcdef0"],
"detail": {
"instance-id": "i-1234567890abcdef0",
"state": "running"
}
}
π€ SaaS Partners
Integration with popular SaaS applications like Shopify, Zendesk, Stripe, and Datadog.
ποΈ Custom Applications
Your own applications can publish custom events using PutEvents API or AWS SDKs.
import boto3
client = boto3.client('events')
response = client.put_events(
Entries=[
{
'Source': 'com.myapp.orders',
'DetailType': 'Order Created',
'Detail': '{"order_id": "12345", "amount": 99.99}',
'EventBusName': 'default'
}
]
)
Event Patterns
Event patterns are JSON objects that define filter criteria for routing events to specific targets.
Pattern Examples
Filter by Source:
{
"source": ["aws.ec2"]
}
Filter by Content:
{
"source": ["aws.ec2"],
"detail-type": ["EC2 Instance State-change Notification"],
"detail": {
"state": ["running", "stopped"]
}
}
Advanced Filtering:
{
"source": ["com.myapp.orders"],
"detail": {
"amount": [{ "numeric": [">=", 100] }],
"customer": {
"tier": ["premium", "enterprise"]
}
}
}
Common Use Cases
π Microservices Integration
Decouple microservices by using events for communication instead of direct API calls.
π Automated Workflows
Trigger automated workflows in response to infrastructure changes or business events.
π Data Pipeline Orchestration
Coordinate ETL processes and data pipeline stages based on completion events.
π Security Monitoring
Monitor security events and trigger automated responses to suspicious activities.
π° Revenue Recognition
Process financial events and trigger revenue recognition workflows.
π± Real-time Notifications
Send notifications to users based on application events and status changes.
Advanced Features
π¦ Archive and Replay
Store events for later analysis and replay them for testing or recovery scenarios.
π Schema Registry
Discover, create, and manage schemas for events. Automatically generate code bindings for popular programming languages.
π API Destinations
Send events to external HTTP/HTTPS endpoints with authentication and rate limiting.
π§ EventBridge Pipes
Point-to-point integration between sources and targets with built-in filtering and transformation.
Pricing
π° Cost Structure: Pay only for what you use - $1.00 per million published events (first million events free)
| Component | Pricing | Free Tier |
|---|---|---|
| Published Events | $1.00 per million | 1 million events/month |
| Schema Discovery | $0.10 per schema | 100 schemas/month |
| Archive Storage | $0.10 per GB/month | First GB free |
Learn More
π Essential Resources
Related Topics
Test Your Knowledge
Score 8/10 or higher to pass
You need to be logged in to take this quiz.
Login to Continue