skip to content

Event Buses, Rules & Targets

You will learn how an event travels through EventBridge: onto a default, custom, or partner bus, matched by an event pattern, reshaped by an input transformer, and delivered to targets with their own retry and DLQ. Interviewers probe archive and replay because it is the feature that makes buses auditable.

part ofAWSoverview, primer and where to startread it →
on this pageshow

questions

6

In Amazon EventBridge, what is the difference between the default event bus, a custom event bus and a partner event bus, and how do you decide which one an application should publish to?

level: middleimportance: must knowfreq 68%

answer

  1. one per account per region, named default
  2. AWS's own events land in exactly one place
  3. isolation: rules, policy, archives, quotas
  4. a bus can itself be a rule target
  5. SaaS inbound without a webhook

basics

~20 s

Every account and region has one default bus, which is where AWS services emit their own events. Custom buses are ones you create for your application's events. Partner buses receive events from a SaaS provider you have associated. Application events belong on a custom bus.

solid answer

~50 s

There is exactly one `default` bus per account per region, and it is the only bus AWS services publish their native events to — an S3 or EC2 event will never land directly on a bus you created. You create **custom** buses for your own domains, each with its own rules, resource policy, archives and quotas. **Partner** buses are created by associating a partner event source from a SaaS provider, so their third-party events arrive without you polling a webhook. The decision is mostly about blast radius and ownership: put application events on a custom bus per bounded context so one team's rule explosion or a noisy producer cannot crowd out another's, and so access and archiving can be scoped per domain. Keep the default bus for AWS service events. If you need those service events on a custom bus, add a rule on `default` whose target is the other bus — a bus is itself a valid rule target.

code

bash · 3 lines
bash
aws events create-event-bus --name orders-bus
aws events put-rule --name forward-s3-ingest --event-bus-name default \
  --event-pattern '{"source":["aws.s3"],"detail-type":["Object Created"]}'

go deeper

for a junior

Be able to name the three kinds of bus and say that the default bus is where AWS's own service events appear. Know that you create custom buses for your application's events.

for a middle

Explain what a bus actually isolates — its own rules, resource policy, archives and quotas — and that AWS service events reach a custom bus only via a forwarding rule whose target is that bus.

for a senior

Show judgment about topology: how you split buses along ownership boundaries, what that buys in blast radius and access scoping, and how forwarding plus resource policies get events across accounts.

for a principal

Own the estate-wide decision: how many buses, who administers them, how producers and consumers discover each other, and the migration cost when a domain later needs its own bus.

## Three kinds of bus An **event bus** is the router: producers put events on it, rules attached to it evaluate every event, and matching rules invoke targets. Everything else in EventBridge hangs off that one idea. **The default bus.** Every AWS account has one per region, literally named `default`. Two things make it special. First, AWS services deliver their own events — an EC2 instance state change, an S3 object-created notification routed through EventBridge, a CodeBuild phase change — only here. You cannot configure `aws.ec2` to publish somewhere else. Second, because it is shared by everything in the account, it is the bus most likely to accumulate rules owned by different teams. **Custom buses.** You create these (`CreateEventBus`) and name them. They receive only what you explicitly publish with `PutEvents` (or what another bus forwards to them). Each one has its own set of rules, its own resource-based policy, its own archives, and its own share of per-bus quotas such as the number of rules. That isolation is the whole point. **Partner buses.** A SaaS vendor that has integrated with EventBridge exposes a *partner event source*; you accept it and EventBridge creates a bus dedicated to that source, with a name under the `aws.partner/` namespace. Their events then arrive on that bus and you write rules exactly as you would anywhere else. The value is operational: no webhook endpoint to run, authenticate, scale and retry — the vendor's events show up as first-class AWS events with the same rules, retries and DLQs. ## How to choose The practical rule is: **default bus for AWS's events, one custom bus per bounded context for yours.** Reasons to split into custom buses rather than putting everything on `default`: - **Blast radius and quotas.** Rules per bus is a quota. A domain that grows to hundreds of rules on the shared default bus becomes everyone's problem; on its own bus it is only its own team's problem. - **Access control.** A bus has a resource policy, so you can say who may `events:PutEvents` to *this* bus. Scoping that per domain is far easier to reason about than one policy on the account's default bus. - **Archives and replay.** Archives are configured per bus. A domain bus gives you a clean, cheap archive of just that domain's events instead of archiving every EC2 state change in the account. - **Clarity.** `orders-bus` tells a reader what flows through it. `default` tells them nothing. A reasonable counter-argument for smaller estates: one custom bus for the whole application is simpler than ten, and consumers can filter by `source` anyway. The split pays off when teams and ownership boundaries multiply, not when the event count does. ## Getting AWS service events onto a custom bus Because AWS services only emit to `default`, a common pattern is a forwarding rule: a rule on the default bus whose **target is another event bus**. Buses are valid targets, which is also how cross-account and cross-region fan-out is built — the receiving bus's resource policy has to permit it, and the rule needs an IAM role that allows `events:PutEvents` on the destination. ```json { "source": ["aws.s3"], "detail-type": ["Object Created"], "detail": { "bucket": { "name": ["acme-ingest"] } } } ``` A rule with that pattern on `default`, targeting `arn:aws:events:eu-west-1:111122223333:event-bus/ingest-bus`, moves just the S3 events you care about into the domain bus, leaving the noisy remainder behind. ## Things candidates get wrong The most frequent error is believing you can point an AWS service at a custom bus — you cannot, and the forwarding rule is the answer. The second is assuming a custom bus changes delivery semantics: it does not. Ordering is still not guaranteed, delivery to targets is still at-least-once, and an event matching no rule is still silently discarded on any bus. The third is treating a partner bus as an outbound channel; it is inbound only — sending events *to* a SaaS vendor is an API destination target, which is a different mechanism.

  • Your team wants S3 Object Created events on their domain bus. What do you set up?
    AWS services publish only to the account's default bus, so add a rule there whose event pattern narrows to the bucket and detail-type you want, and set the domain bus as that rule's target. Grant the rule an IAM role permitting `events:PutEvents` on the destination bus, and make sure the destination bus's resource policy allows it if it lives in another account.
  • When would you argue against splitting into many custom buses?
    When ownership does not actually split. Extra buses cost nothing but add topology: forwarding rules, more policies, more archives, and consumers who must know which bus to subscribe to. For a single team, one custom bus with disciplined `source` values is simpler, and you can split later — the producers change one field, the consumers keep their patterns.
  • Can a partner event bus be used to send events to the SaaS provider?
    No — a partner bus is strictly inbound; it exists so the vendor's events arrive as native EventBridge events. Outbound integration with a third-party HTTP service is a different mechanism: an API destination target, which holds the endpoint plus a connection carrying the auth, and is invoked by a rule like any other target.

saying these in an interview costs you the question

  • Claiming an AWS service can publish directly to a custom bus
  • Thinking each account can have several default buses
  • Believing a custom bus changes ordering or delivery guarantees
  • Describing a partner bus as an outbound channel to the SaaS vendor
  • Assuming rules on one bus can see events from another

context

open as a page

How does an EventBridge rule's event pattern decide whether an event matches, and how would you debug a rule that never fires?

level: middleimportance: must knowfreq 72%

basics

~20 s

An event pattern mirrors the event's JSON structure: every field named in the pattern must match, values inside an array are alternatives, and fields the pattern omits are ignored. String matches are exact and case-sensitive unless you use a content filter such as prefix or wildcard.

open as a page

When an application publishes a custom event to Amazon EventBridge with the PutEvents API, what does an event entry contain, and why can a call that returns HTTP 200 still have lost events?

level: juniorimportance: should knowfreq 52%

basics

~20 s

A PutEvents entry carries Source, DetailType and Detail, plus optional EventBusName, Resources and Time. Because PutEvents is a batch call, a 200 response can still report FailedEntryCount above zero, and those rejected entries are lost unless the publisher resends them.

open as a page

What do EventBridge archives and replay give you, and what would you be careful about before replaying events into a production bus?

level: seniorimportance: should knowfreq 38%

basics

~20 s

An archive durably retains the events on a bus, optionally filtered by a pattern and kept for a chosen retention period. Replay re-publishes a time range of archived events to that bus's rules, which lets you recover from a broken consumer or backfill a new one.

open as a page

A rule's target intermittently rejects deliveries. How does EventBridge retry a target invocation, and what do you configure so failed events are not silently lost?

level: seniorimportance: should knowfreq 56%

basics

~20 s

EventBridge retries a failing target with exponential backoff for up to 24 hours by default. You bound that with a retry policy setting maximum attempts and maximum event age, and you attach a dead-letter queue — an SQS queue, configured per target — so exhausted or non-retryable events are captured instead of dropped.

open as a page

An EventBridge rule must deliver to a target that expects a payload shape different from the raw event. What do a target's Input, InputPath and InputTransformer settings do, and when do you still need a Lambda in between?

level: middleimportance: nice to knowfreq 36%

basics

~20 s

Input sends a fixed constant payload, InputPath sends a JSONPath-selected subset of the event, and InputTransformer binds JSONPath extractions to named variables and substitutes them into a template. All three only reshape what is already in the event; enrichment needs code.

open as a page