SkillSprout
Chapter 8 · Lesson 3
Intermediate
7 min read

EventBridge

Overview

Amazon EventBridge is a serverless event bus that connects applications using events. Producers (your applications, AWS services or SaaS partners such as Zendesk and Datadog) publish events, and rules match those events and route them to targets such as Lambda, SQS, SNS, Step Functions, Kinesis or even another event bus. Producers and consumers never need to know about each other, which makes systems loosely coupled and easy to extend.

EventBridge is the evolution of CloudWatch Events: it uses the same rules engine and API but adds custom and partner event buses, a schema registry, archive and replay, cross-account and cross-Region delivery, EventBridge Scheduler for cron-style jobs, and EventBridge Pipes for point-to-point integrations.

Typical uses include reacting to AWS state changes (an EC2 instance stops, a GuardDuty finding appears), running scheduled jobs, building event-driven microservices and integrating SaaS applications.

Key Concepts

  • Event buses: the default bus (receives AWS service events automatically), custom buses (your own apps) and partner buses (SaaS providers).
  • A rule has an event pattern (JSON filter) or a schedule (cron/rate) and routes matching events to up to 5 targets per rule.
  • Targets include Lambda, SQS, SNS, Step Functions, Kinesis, ECS tasks, API destinations, CodePipeline, another event bus and 100+ others.
  • Input transformers reshape the event before delivery; API destinations call external HTTPS endpoints with rate limits and auth.
  • Archive and replay store events (indefinitely or for a set period) and replay them later to test, recover or reprocess.
  • Schema registry discovers event structure and generates code bindings; cross-account and cross-Region buses let teams share events centrally.
  • Delivery: at-least-once; failed deliveries are retried for up to 24 hours (up to 185 times) and can go to a DLQ (SQS).
  • EventBridge Scheduler (millions of one-time/recurring schedules with time zones) and Pipes (source -> filter -> enrich -> target) extend the service.

Detailed Notes

Core model

text
Event source -> Event bus -> Rule (pattern or schedule) -> Target(s)
 (AWS / app / SaaS)  (default / custom / partner)       (Lambda, SQS, SNS, Step Functions ...)

An event is a JSON document with standard fields (source, detail-type, detail, account, region, time) up to 256 KB. Rules use event patterns to filter on any field, including content-based filtering such as prefix, numeric ranges, exists and anything-but.

json
{
  "source": ["aws.ec2"],
  "detail-type": ["EC2 Instance State-change Notification"],
  "detail": { "state": ["terminated", "stopped"] }
}

Event buses

BusPurpose
DefaultReceives events from AWS services (EC2, S3 via CloudTrail, GuardDuty, CodePipeline, etc.)
CustomYour own application events, shared across accounts via resource policy
PartnerEvents from SaaS partners (Zendesk, Shopify, Auth0)

Rules, schedules and targets

  • A rule can match patterns or run on a schedule (rate(5 minutes) or cron(0 8 ? * MON-FRI *)). Each rule supports up to 5 targets, and the account soft limit is 300 rules per bus.
  • Targets use an IAM role (or resource policy) to be invoked. Dead-letter queues and a retry policy (maximum event age up to 24 hours) handle failures.
  • Input transformers extract fields and build a custom payload for the target.
FeatureEventBridgeSNSSQS
ModelEvent routing by contentPub/sub fan-outQueue (pull)
FilteringRich content filteringFilter policiesNone (consumer filters)
SaaS / AWS service eventsNativeNoNo
Targets20+ target typesSubscribers (Lambda, SQS, HTTP, email, SMS)One consumer group
ReplayYes (archive)NoNo
ThroughputHighVery highVery high

Scheduler and Pipes

  • EventBridge Scheduler replaces most CloudWatch/EventBridge cron rules: supports one-time and recurring schedules, time zones, flexible time windows and millions of schedules, invoking 270+ services directly.
  • EventBridge Pipes connects a source (SQS, Kinesis, DynamoDB Streams, MSK) to a target with optional filtering, enrichment (Lambda, API Gateway) and transformation, with no glue code.

Archive, replay and schema registry

  • Create an archive with an event pattern and retention; replay events from a time window to the same bus to test new consumers or recover from a bug.
  • Schema discovery records the schema of events on a bus; download code bindings (Java, Python, TypeScript) for strongly typed handlers.

Cross-account and cross-Region

A bus resource policy allows other accounts to send events; a rule can target a bus in another account or Region, enabling a central event hub for security findings or multi-account governance.

bash
aws events put-rule --name nightly-report \
  --schedule-expression "cron(0 2 * * ? *)"

aws events put-targets --rule nightly-report \
  --targets "Id"="1","Arn"="arn:aws:lambda:us-east-1:123456789012:function:report"

aws events put-events --entries \
  '[{"Source":"shop.orders","DetailType":"OrderPlaced","Detail":"{\"orderId\":\"42\"}"}]'

Security and monitoring

Control who can publish or manage rules with IAM and bus resource policies; events can be encrypted with KMS. Monitor Invocations, FailedInvocations, ThrottledRules and DLQ depth in CloudWatch, and audit API calls in CloudTrail.

Real World Example

Scenario — a travel-booking company moves from a monolith to event-driven microservices.

When a customer completes a booking, six teams need to react: payments, email, loyalty points, analytics, fraud scoring and a partner CRM. Direct service-to-service calls made the booking flow slow and fragile.

The booking service now publishes a single BookingConfirmed event to a custom event bus. Separate rules route it to the email Lambda, a loyalty SQS queue, a Step Functions fraud workflow and an API destination that pushes to the CRM with rate limiting. New consumers subscribe by adding a rule, without touching the booking code. An archive stores 90 days of events; when a bug corrupted the loyalty service, the team replayed two days of events to rebuild it. A nightly EventBridge Scheduler job triggers reconciliation, and security findings from all accounts flow into a central bus in the security account.

Architecture Diagram

EventBridge event-driven routing
Architecture
AWS Cloud

Producers

Booking service
AWS service events
SaaS partner
Region
Event busrules + patterns
Archive & replay

Targets

Lambdasend email
SQSloyalty queue
Step Functionsfraud check
SNS

One published event fans out to many targets through content-based rules.

  1. 1Applications, AWS services and SaaS partners publish events to an event bus.
  2. 2Rules compare each event against their pattern; every matching rule routes it to up to five targets.
  3. 3Targets such as Lambda, SQS, Step Functions and SNS process the event independently, with retries and DLQs on failure.
  4. 4An archive stores events so they can be replayed later to recover or onboard new consumers.

Best Practices

  • ✓Publish business events to a custom bus and keep the default bus for AWS service events; version event schemas (detail-type).
  • ✓Be specific in event patterns to avoid unnecessary invocations, and use content filtering rather than filtering in code.
  • ✓Configure DLQs and retry policies on every important target, and make consumers idempotent (delivery is at-least-once).
  • ✓Use EventBridge Scheduler for cron and one-time jobs at scale instead of many individual rules.
  • ✓Use archives and replay for debugging, testing and recovery, and the schema registry for contracts between teams.
  • ✓Build a central event bus in a hub account for cross-account governance, security findings and shared domain events.
  • ✓Use Pipes for simple point-to-point flows from queues and streams instead of writing glue Lambda functions.
  • ✓Grant least-privilege IAM roles to rules and restrict bus policies to specific accounts or organisations.

Common Interview Questions

Exam Tips

SAA-C03 focus

  • EventBridge = CloudWatch Events + more: custom/partner buses, schema registry, archive/replay, cross-account. Questions about "react to AWS service events" -> EventBridge.
  • "Run a task on a schedule (cron) without servers" -> EventBridge Scheduler / scheduled rule -> Lambda, Step Functions or ECS task.
  • "Integrate a SaaS application (Zendesk, Shopify, Datadog) with AWS" -> EventBridge partner event source.
  • "Replay past events" -> EventBridge archive and replay (SNS and SQS cannot replay).
  • A rule supports up to 5 targets; failed deliveries retry for up to 24 hours then go to a DLQ.
  • Choose SNS for simple pub/sub fan-out, SQS for buffering and decoupling, EventBridge for routing/filtering events, Kinesis for ordered streaming.
  • "Respond to API activity (e.g. someone changes a security group)" -> CloudTrail event on EventBridge -> Lambda/SNS remediation.
  • Events are JSON up to 256 KB and delivered at least once - design idempotent consumers.

Finished this lesson?

0 of 64 lessons done · 0% of the course