EventBridge
Routing events by content with buses, rules and patterns, the newer subscriber-based Custom Event Bus, retries, archives, Pipes and Scheduler.
SNS topics and fan-outSQS queuesIAM users, groups, roles and policies
EventBridge
The player loads from youtube-nocookie.com when you press play. Nothing reaches YouTube before that.
Not started
What you'll learn
- An event is a JSON record of something that happened. A rule matches events by content and sends them to targets, so producers never name their consumers.
- AWS services publish to your account's default bus. Use your own bus for your application's events.
- Pattern matching is exact. A field that differs in case or a missing field means no match, so test patterns against real events.
- Classic rules retry a failing target for 24 hours and up to 185 times by default, then drop the event unless the target has a dead-letter queue.
- AWS now offers a Custom Event Bus with subscribers, built-in retention and ordering, and recommends it for new applications. The rules-and-targets bus is called Custom Event Bus - Classic.
- Use EventBridge Scheduler for timed work and Pipes to move items from one source to one target with filtering and enrichment.
Routing by what happened
With a topic, the publisher picks the topic, and that choice is the routing. As a system grows you want the publisher to say only what happened, and let the routing be decided by the content: orders over 100 go to fraud review, any failed build pages someone, every new account starts a welcome workflow.
Amazon EventBridge is that router. Think of a mail sorting room. Senders drop letters in one slot, and sorting rules read the front of each envelope to decide which bags it goes into.
Events, buses, rules
An event is a JSON document with a standard envelope. Your fields go in detail; source and detail-type say who sent it and what kind it is.
An event bus receives events. Every account has a default bus, which is where AWS services publish things like an EC2 instance changing state. You create custom buses for your own events.
A rule belongs to one bus and holds an event pattern plus up to 5 targets, such as a queue, a function, a state machine or another bus. A pattern lists acceptable values for the fields you care about:
{
"source": ["com.example.shop"],
"detail-type": ["OrderPlaced"],
"detail": { "total": [{ "numeric": [">=", 100] }] }
}
I created a bus called shop, put this rule on it with an SQS queue as target, and published three events against moto, a local emulator: an order of 250, an order of 40, and an order of 900 whose detail-type was written orderplaced. One message arrived:
{"id": "ab45163c-...", "time": "2026-11-29T04:14:39Z", "version": "0",
"detail-type": "OrderPlaced", "source": "com.example.shop",
"region": "eu-west-1", "resources": [],
"detail": {"orderId": "A1", "total": 250}}
The small order failed the numeric test. The big one failed on a single lower-case letter, because matching is exact. Nothing told the publisher: FailedEntryCount was 0. An event that matches no rule is not an error.
One place moto differs: it rejected a publish to a non-existent bus with ResourceNotFoundException. AWS documents that the real service returns 200 and the event is dropped. Check your bus names.
Delivery and failure
Delivery is asynchronous and can happen more than once, so make targets idempotent. If a target fails with a retriable error, a rule retries with backoff for 24 hours and up to 185 times by default. After that the event is gone unless you gave that target a dead-letter queue. Each target also needs permission: a resource policy on the target or an IAM role EventBridge can assume.
An archive stores events from a bus, optionally filtered, and can replay them later. Replay re-runs real side effects, so idempotency matters again.
The newer Custom Event Bus
AWS has added a second kind of bus and renamed the old one. The rules-and-targets bus above is now Custom Event Bus - Classic. The new Custom Event Bus differs in shape:
Classic (and default) |
Custom Event Bus | |
|---|---|---|
| Routing object | a rule with up to 5 targets | a subscriber with one target |
| Who creates it | the bus owner | the consumer, including other accounts |
| Keeping events | add an archive | retention of 1 to 365 days built in |
| Ordering | none | FIFO within an event group |
| CLI | aws events |
aws eventsv2 |
AWS recommends the new one for new applications. Classic remains available, and AWS service events still land on the default bus. The defaults differ too: a new bus keeps events for 1 day unless you say otherwise, and a subscriber retries 5 times within 300 seconds, far less patient than a Classic rule. IAM actions for both still start with events:.
The rules model is what you’ll meet in existing systems and in most material, including the video. The new bus is recent, so confirm Region availability before designing around it. I could not run it: the CLI version in this lab has no eventsv2 command.
Pipes and Scheduler
Two relatives share the name. EventBridge Pipes connects one source (an SQS queue, a Kinesis or DynamoDB stream and others) to one target, with optional filtering and enrichment in between. It replaces glue functions that only read, reshape and forward.
EventBridge Scheduler runs things on a cron or rate schedule, or once at a set time, against a wide range of AWS API actions. Scheduled rules on a bus still work but are documented as legacy.
Choosing
Use SNS for simple, high-volume copying. Use a bus when events come from many places and consumers care about content. Put an SQS queue behind a target that needs buffering. For ordered, replayable streams at high volume, see Kinesis.
About the video
The embed is a clip (6:09 to 41:45) of AWS re:Invent 2023’s “Advanced event-driven patterns with Amazon EventBridge”. Its chapters in that range cover an EventBridge overview, managing complexity, designing event schemas, choreography, integrations without code, resiliency and circuit breakers, and archive and replay. It predates the Custom Event Bus with subscribers, so everything in it is about the Classic model. I judged it from chapters and description only, since transcripts couldn’t be fetched. English was judged from its English caption track and title. A 6-minute introduction from Serverless Land is in deeper if you want the basics first.
What was run: the bus, rule, pattern and delivered event are from moto 5.1.22, an emulator. The Custom Event Bus, retry defaults, target limit, Pipes and Scheduler are from the AWS docs, checked 2026-11-29.
Where this fits
Queues, topics and buses move individual messages. The last messaging lesson keeps an ordered log that many readers can replay: Kinesis and Firehose.
Check yourself
Your PutEvents call returned HTTP 200 but some events never reached a target. What are three things to check?
The response's FailedEntryCount, since a batch can partly fail with a 200. The bus name, since AWS documents that publishing to a bus that does not exist drops the event without failing. And the rule pattern against the real event, for example the case of detail-type.
A rule's target Lambda function was broken for two days. Are the events still somewhere?
Only if you planned for it. The default retry window is 24 hours, after which the event is dropped unless the target has a dead-letter queue. An archive on the bus would also let you replay them.
You want one DynamoDB stream to feed one Step Functions workflow, dropping deletes and adding customer details on the way. Rule or pipe?
A pipe. It is point to point, with a filter and an enrichment step built in. A bus is for many sources and many consumers.
A new consumer needs the last 10 days of order events. What does each kind of bus require?
On the Classic bus you need an archive that was already collecting, and you replay it. On the Custom Event Bus you need retention of at least 10 days set on the bus, then create a subscriber with a starting position in the past.
Go deeper
Notes
Notes are saved to your account.
Everything else on this page works without one — progress and bookmarks keep themselves in this browser and come with you when you sign in. Notes are the one thing worth not trusting to a browser you might clear.
Your notes could not be loaded.