Xoxoftware - XOXO Creative Studio | Web & Mobile App Development | Fred Cheung | Hong Kong
AWSMessaging

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

ConceptDescription
Event BusA channel that receives events; each account has a default bus plus custom buses
EventA JSON object describing a state change (source, detail-type, detail, time, etc.)
RuleMatches incoming events on a bus and routes them to one or more targets
Event PatternJSON pattern on a rule that filters events by source, detail-type, or detail fields
ScheduleA cron or rate expression that triggers a rule on a time-based schedule
TargetThe destination that receives matched events (Lambda, SQS, Step Functions, etc.)
Schema RegistryAuto-discovered or manually registered event schemas for code generation
PipePoint-to-point integration: source → optional filter → optional enrichment → target
ArchiveStores events for replay; configurable retention period
ReplayRe-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 CategoryExamples
ComputeLambda, ECS task, Batch job, EC2 (via SSM Run Command)
MessagingSQS, SNS, Kinesis Data Stream, Kinesis Data Firehose
OrchestrationStep Functions state machine, CodePipeline
APIAPI Gateway, API Destination (third-party HTTP endpoints)
Cross-account/regionEvent bus in another account or region
LoggingCloudWatch 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

CriteriaEventBridgeSNSSQS
ModelEvent bus + content-based routingPub/sub fan-outQueue (point-to-point)
FilteringRich JSON content filteringAttribute-based filter policiesNo native filtering
SaaS integrationYes — built-in partner sourcesNoNo
Schema discoveryYesNoNo
Archive and replayYesNoNo (DLQ for failed messages)
ThroughputVaries by region (soft limit)Nearly unlimitedNearly unlimited
LatencySub-second (slightly higher)Sub-secondSub-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

ProviderService / SolutionNotes
AWSAmazon EventBridgeBaseline
AzureAzure Event GridEvent routing with filtering; similar model
GCPEventarcEvent routing for Cloud Run and Cloud Functions
On-PremisesApache Kafka, RabbitMQ (with plugins), NATSRequires custom routing logic

Pricing Model

DimensionUnitNotes
Custom eventsPer million eventsPublished via PutEvents API
AWS/partner eventsFreeAWS service events and partner events at no cost
Schema discoveryFreeIncluded at no additional charge
Archive + replayPer GB archivedReplay events incur per-event charges
PipesPer million requestsPlus data processing per GB

Built by Fred Cheung @CookedRicer · Powered by Fumadocs & Github Copilot

On this page