GenAIHub
← Back to Technical Section

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.

Real-time

Event delivery

Serverless

No infrastructure

Scalable

Millions of events

Cost-effective

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.

Shopify
Zendesk
Stripe
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

Related Topics

Test Your Knowledge

Score 8/10 or higher to pass