Prev Next

Cloud / Amazon EventBridge Interview questions

Last updated

1. What is Amazon EventBridge? 2. What is an event in EventBridge? 3. What is the structure of an EventBridge event? 4. What is an event bus in Amazon EventBridge? 5. What are the types of event buses in EventBridge? 6. What is a rule in EventBridge? 7. What is an event pattern in EventBridge? 8. What are targets in EventBridge? 9. What are the event sources supported by EventBridge? 10. What is the relationship between EventBridge and CloudWatch Events? 11. How do you send custom events to EventBridge? 12. How do you trigger a Lambda function from an EventBridge rule? 13. What is EventBridge Scheduler? 14. What is EventBridge Pipes? 15. What is the EventBridge Schema Registry? 16. What is an event archive in EventBridge? 17. What is event replay in EventBridge? 18. What are partner event sources in EventBridge? 19. What are API destinations in EventBridge? 20. What is an input transformer in EventBridge? 21. What are the key EventBridge quotas to know? 22. What is the difference between EventBridge and SNS? 23. What is the difference between EventBridge and SQS? 24. When should you choose EventBridge over Kinesis Data Streams? 25. How does EventBridge match events against rule patterns? 26. What happens when multiple rules match the same event? 27. Explain the execution flow of an event from PutEvents to a target? 28. How does EventBridge handle retries and failed deliveries? 29. How do you configure a dead-letter queue for an EventBridge target? 30. Why doesn't EventBridge guarantee ordering or exactly-once delivery? 31. How do you make EventBridge consumers idempotent? 32. How do you deliver EventBridge events to a FIFO SQS queue? 33. How does cross-account event delivery work in EventBridge? 34. How does cross-Region event routing work in EventBridge? 35. How do EventBridge global endpoints improve availability? 36. What is the difference between EventBridge Scheduler and scheduled rules? 37. What is the difference between EventBridge Pipes and EventBridge rules? 38. How do API destinations handle authentication and rate limiting? 39. How do you secure an Amazon EventBridge event bus? 40. How does EventBridge react to AWS API calls through CloudTrail? 41. How do you monitor EventBridge with CloudWatch metrics? 42. How do you test an event pattern before deploying a rule? 43. How do you troubleshoot an EventBridge rule that is not triggering? 44. Why should you use a custom event bus instead of the default bus? 45. How do you design event schemas for versioning in EventBridge? 46. When would you choose Step Functions as an EventBridge target? 47. What is the difference between choreography and orchestration in EventBridge? 48. How can you optimize EventBridge cost and performance? 49. How do you define an EventBridge rule in CloudFormation? 50. How would you design a resilient event-driven order system with EventBridge?

1. What is Amazon EventBridge?

Amazon EventBridge is a serverless event bus from AWS. It receives events from AWS services, your own applications and SaaS partners, and routes them to targets based on rules you define. Services can react to each other without calling each other directly.

A producer publishes an event to a bus, rules compare it against event patterns, and every matching rule delivers it to its targets, such as Lambda, SQS, SNS or Step Functions. There is nothing to provision and capacity scales automatically.

The service also bundles Scheduler for time-based invocations, Pipes for point-to-point integrations, a Schema Registry, and archive and replay.

Take quiz
What does EventBridge do with an incoming event?
Converts it into a relational table row
Stores it permanently in S3 for SQL queries
Matches it against rules and routes it to targets
Which statement describes how EventBridge is operated?
Serverless, with no brokers to size or patch
It needs a dedicated Kafka cluster per bus
You provision and size broker instances yourself

2. What is an event in EventBridge?

An event is a JSON document that records something that already happened, such as an EC2 instance entering the stopped state or a customer placing an order. It is a fact, not a command asking another service to do work.

Each event has a standard envelope (source, detail-type, time and so on) plus a free-form detail object that carries the payload. Producers publish without knowing who will consume the event.

Name events in the past tense, like OrderPlaced, so consumers treat them as notifications rather than instructions.

Take quiz
An EventBridge event is best described as:
A JSON record of something that already happened
A request telling one specific service what to do
A binary chunk read from a stream by offset
Which name best follows event naming conventions?
PayInvoiceNow
InvoicePaid
RunPaymentJob

3. What is the structure of an EventBridge event?

Every event shares the same envelope, and only detail is free-form. Rules usually match on the envelope fields plus values inside detail.

Field Meaning
version Event format version, set by EventBridge
id Unique event ID generated by EventBridge
detail-type Human-readable event type, for example OrderPlaced
source Producer of the event, such as aws.ec2 or com.shop.orders
account, region Where the event originated
time Timestamp in UTC
resources Optional list of ARNs the event is about
detail JSON payload specific to the event

{
  "version": "0",
  "id": "6a7e8feb-b491-4cf7-a9f1-bf3703467718",
  "detail-type": "OrderPlaced",
  "source": "com.shop.orders",
  "account": "111122223333",
  "time": "2026-10-02T09:15:00Z",
  "region": "us-east-1",
  "resources": [],
  "detail": { "orderId": "A-1001", "total": 249.5 }
}

Take quiz
Which field holds the application-specific payload?
detail-type
detail
resources
What does the source field identify?
The IAM role used for delivery
The target that will receive it
The service or application that produced the event

4. What is an event bus in Amazon EventBridge?

An event bus is the pipeline that receives events and hands them to rules. Producers send events to a bus, and the rules attached to that bus decide which targets get each event.

Each bus has its own ARN, its own set of rules and its own resource-based policy. That policy is what allows other accounts or an AWS Organization to put events on the bus.

Every account has one default bus per Region, and you can add as many custom buses as you need.

Take quiz
Rules in EventBridge are attached to:
An S3 bucket
An individual Lambda function
An event bus
What lets another AWS account put events on your bus?
The bus resource-based policy
The Lambda execution role of the consumer
The target's dead-letter queue

5. What are the types of event buses in EventBridge?

EventBridge has three kinds of event buses, and they differ mainly in who sends events to them.

Bus type Receives events from Notes
Default AWS services in your account One per account per Region, cannot be deleted
Custom Your own applications or other buses Created by you, one per domain or team is common
Partner A SaaS partner event source Created when you associate a partner event source with your account

Rules and resource policies work the same way on all three. Scheduled rules are the exception, since they only exist on the default bus.

Take quiz
Which bus receives AWS service events automatically?
The default bus
A custom bus named after the Region
A partner event bus
You need a bus for your own order domain events. Which type fits?
A partner event bus
A custom event bus
Only the default bus, since custom buses cannot be created

6. What is a rule in EventBridge?

A rule watches a single event bus and sends matching events to one or more targets. It is the routing logic: a filter on one side, a list of targets on the other.

There are two kinds. An event pattern rule matches events by their content. A scheduled rule fires on a rate or cron expression and only exists on the default bus.

A rule can have up to five targets, can be enabled or disabled without deleting it, and can reshape the event with an input transformer before delivery.

Take quiz
How many targets can one rule have?
Exactly one
Up to five
No limit at all
Where can scheduled rules be created?
Only on partner event buses
On any custom bus
Only on the default bus

7. What is an event pattern in EventBridge?

An event pattern is a JSON filter that mirrors the shape of the event you want to match. Each field you list must match, and each field you leave out is ignored.

Pattern values are always arrays. Several values in one array are treated as OR, while several fields are treated as AND. Matching is case-sensitive.

{
  "source": ["com.shop.orders"],
  "detail-type": ["OrderPlaced"],
  "detail": { "status": ["PAID", "SHIPPED"] }
}

Take quiz
In {"source":["app.orders","app.billing"]}, how are the values combined?
AND, so both must match
Only the first value is used
OR, so either source matches
Fields missing from a pattern are:
Ignored during matching
Required to be empty
Required to exist with any value

8. What are targets in EventBridge?

A target is the resource that EventBridge calls when an event matches a rule. Common targets include Lambda, SQS, SNS, Step Functions, Kinesis, Firehose, ECS tasks, API Gateway, CloudWatch Logs, another event bus, and external HTTP endpoints through API destinations.

Permissions depend on the target type:

Target How EventBridge gets permission
Lambda, SQS, SNS Resource-based policy on the target
Step Functions, ECS, Kinesis, API Gateway, other buses IAM role that the rule assumes

Each target can also have its own input settings, retry policy and dead-letter queue.

Take quiz
A Lambda target is normally authorised through:
A resource-based policy on the function
An S3 bucket policy
A Route 53 hosted zone record
Which of these is a valid EventBridge target?
A Route 53 hosted zone record
Another event bus
An IAM user's access key

9. What are the event sources supported by EventBridge?

EventBridge accepts events from four main places.

  1. AWS services, which publish state changes to the default bus automatically and at no charge, for example EC2, S3, CodePipeline and GuardDuty.
  2. Your applications, which call PutEvents through an SDK or the CLI.
  3. SaaS partners, such as Zendesk or Datadog, through partner event sources.
  4. Other event buses, in the same or another account or Region.

Calls recorded by CloudTrail also arrive as events, which lets you react to almost any AWS API call.

Take quiz
Which source calls PutEvents to publish?
AWS services on the default bus
Your own application code
SaaS partner event sources
AWS service events land on which bus?
The partner event bus
A custom bus you create per service
The default bus

10. What is the relationship between EventBridge and CloudWatch Events?

EventBridge is the evolution of CloudWatch Events. Both use the same underlying service and the same API namespace, so the aws events CLI commands and the AWS::Events::Rule resource type are unchanged.

Rules you created in CloudWatch Events show up in EventBridge as rules on the default bus, and rules you create in the EventBridge console appear in the older console too. Nothing needs to be migrated, and existing targets keep working.

EventBridge adds the things the original did not have: custom and partner buses, the Schema Registry, archive and replay, API destinations, Pipes and Scheduler.

Take quiz
Existing CloudWatch Events rules appear in EventBridge as:
A separate legacy service to migrate to
Deleted rules that must be recreated
Rules on the default bus
Which feature came with EventBridge rather than CloudWatch Events?
Partner event sources
Cron-based scheduled rules
The default event bus

11. How do you send custom events to EventBridge?

Call the PutEvents API from an SDK, the CLI or any service that can sign AWS requests. Each entry needs a Source, a DetailType and a Detail JSON string, and you can name the target bus with EventBusName.

import boto3, json
events = boto3.client("events")

resp = events.put_events(Entries=[{
    "EventBusName": "orders-bus",
    "Source": "com.shop.orders",
    "DetailType": "OrderPlaced",
    "Detail": json.dumps({"orderId": "A-1001", "total": 249.5})
}])
print(resp["FailedEntryCount"])

A request can carry up to 10 entries, and the whole request must stay under 256 KB. PutEvents can return HTTP 200 while individual entries fail, so always check FailedEntryCount and retry the failed ones. Sources starting with aws. are reserved.

Take quiz
What should you inspect after PutEvents returns HTTP 200?
FailedEntryCount in the response
Only the CloudTrail log for the call
Nothing, since 200 means every entry was accepted
Which fields are required in a PutEvents entry?
EventBusName and Time
Source, DetailType and Detail
Only Detail

12. How do you trigger a Lambda function from an EventBridge rule?

Create a rule with an event pattern, add the function as a target, and let the function's resource policy allow events.amazonaws.com to invoke it. The console adds that permission for you. With the CLI or IaC you add it yourself.

aws events put-rule --name order-paid \
  --event-pattern '{"source":["com.shop.orders"],"detail-type":["OrderPaid"]}'

aws lambda add-permission --function-name process-order \
  --statement-id eb-order-paid --action lambda:InvokeFunction \
  --principal events.amazonaws.com \
  --source-arn arn:aws:events:us-east-1:111122223333:rule/order-paid

aws events put-targets --rule order-paid \
  --targets "Id"="1","Arn"="arn:aws:lambda:us-east-1:111122223333:function:process-order"

EventBridge invokes Lambda asynchronously, and the whole event becomes the function's input. Lambda's own async retry settings and failure destinations then apply.

Take quiz
How does EventBridge invoke a Lambda target?
By having Lambda poll the bus
Asynchronously, passing the event as input
Synchronously, waiting for the return value
Why is lambda:InvokeFunction added with principal events.amazonaws.com?
Lambda needs permission to read the event bus
The rule executes inside the function's runtime
The function's resource policy must allow EventBridge to call it

13. What is EventBridge Scheduler?

EventBridge Scheduler is a serverless scheduler for running one-time or recurring tasks at scale. You define a schedule, a target and an optional payload, and it calls the target on time.

It supports at() one-time expressions, rate() and cron(), with time zone and daylight saving support. A flexible time window can spread invocations to avoid spikes, and schedules live in schedule groups.

Scheduler can call a very wide range of AWS API actions directly as universal targets, and it has retry policies and dead-letter queues. It is built to hold millions of schedules, such as one reminder per customer.

Take quiz
Which expression type does Scheduler support that scheduled rules do not?
cron() expressions
rate() expressions
One-time at() schedules
What does the flexible time window do?
Spreads invocations across a window to avoid spikes
Keeps schedules alive after deletion
Extends the retention of archived events

14. What is EventBridge Pipes?

EventBridge Pipes connects one source to one target with optional filtering and enrichment in between. It removes the glue Lambda code you would otherwise write to move messages between services.

flowchart LR
  S[Source] --> F[Filter]
  F --> E[Enrichment]
  E --> T[Target]

Supported sources include SQS, Kinesis, DynamoDB Streams, Amazon MSK, self-managed Kafka and Amazon MQ. Enrichment can be Lambda, Step Functions, API Gateway or an API destination, and targets cover most EventBridge target types.

Pipes polls the source and handles batching and retries for you. Unlike a bus, it is strictly point-to-point.

Take quiz
What is the order of stages in a pipe?
Source, filter, enrichment, target
Enrichment, source, filter, target
Source, target, filter, enrichment
Which of these can be a pipe source?
An S3 bucket listing
A DynamoDB stream
A CloudFront distribution

15. What is the EventBridge Schema Registry?

The Schema Registry stores the structure of your events so developers can discover and reuse it. Schemas are saved in OpenAPI 3 or JSON Schema Draft 4 format and are versioned.

Schemas for AWS service events are already there. For your own events you can turn on schema discovery on a bus, and EventBridge infers a schema from the traffic it sees and creates a new version when the shape changes.

From a schema you can download code bindings for languages like Java, Python and TypeScript. That gives you typed classes for events instead of hand-written JSON parsing.

Take quiz
What does schema discovery do?
Blocks events that do not match a pattern
Infers schemas from events passing through a bus
Encrypts event payloads at rest
What do code bindings provide?
A replay of archived events
A cross-account bus policy
Typed classes generated from an event schema

16. What is an event archive in EventBridge?

An archive stores copies of events from a bus so they can be replayed later. You create it for one bus, choose a retention period in days or keep events indefinitely, and optionally add an event pattern so only some events are kept.

Archiving is useful for recovering from a bug in a consumer, seeding a new environment with realistic traffic, or auditing what flowed through a bus.

Archives are billed for storage and ingestion, so filter with a pattern instead of archiving everything by default.

Take quiz
What can you set on an archive?
A target Lambda function for each event
A cron schedule for deleting the bus
A retention period and an optional event pattern
Why filter an archive with an event pattern?
To store and pay for only the events you may need
Because unfiltered archives cannot be replayed
To make events arrive in order

17. What is event replay in EventBridge?

Replay re-sends archived events from a chosen time range back to the bus they came from. You can send them to all rules or limit the replay to specific rules.

Replayed events keep their original time and gain a replay-name field, so consumers and rules can tell them apart from live traffic. Replays are not instantaneous, and ordering is not guaranteed.

Because side effects will run again, consumers must be idempotent. Scoping the replay to one rule is the safest way to rerun just the consumer you fixed.

Take quiz
What field is added to replayed events?
replay-name
retry-count
archive-id
What is the safest way to rerun only a repaired consumer?
Delete the archive and republish live
Limit the replay to that consumer's rule
Replay to every rule on the bus

18. What are partner event sources in EventBridge?

A partner event source lets a supported SaaS provider, such as Zendesk, Datadog or Auth0, send events straight to your account. The provider creates the source, you accept it, and EventBridge gives you a partner event bus, with a name that starts with aws.partner/.

You then write rules on that bus like any other. This avoids running webhooks receivers or polling the SaaS API.

Events flow one way, from the partner into your account. The partner's own AWS account is never given access to your resources.

Take quiz
What do you create after accepting a partner event source?
An IAM user for the provider
A partner event bus you can attach rules to
A VPC peering link to the provider
Which prefix do partner event bus names use?
saas.events/
custom.partner/
aws.partner/

19. What are API destinations in EventBridge?

API destinations let a rule call any HTTPS endpoint, including SaaS APIs or on-premises services, as if it were a native target. You define a connection that holds the authentication, and a destination that holds the URL, HTTP method and rate limit.

Connections support basic auth, API keys and OAuth client credentials. Credentials are stored in AWS Secrets Manager and are not exposed in the rule.

Because the endpoint is outside AWS, the destination has a configurable invocation rate limit to protect it, and the request has a short timeout of about five seconds.

Take quiz
Where is the authentication for an API destination defined?
In the SQS dead-letter queue
In the event pattern
In a connection
What is the invocation rate limit for?
Protecting the external endpoint from being overwhelmed
Limiting how many rules a bus can hold
Controlling archive retention

20. What is an input transformer in EventBridge?

An input transformer reshapes the event before it reaches a target. You pick values with input paths and compose the output with an input template.

Input path:
{ "orderId": "$.detail.orderId", "total": "$.detail.total" }

Input template:
{ "message": "Order <orderId> paid, total <total>" }

This is handy for sending a clean message to SNS or SQS, or for shaping the body that an API destination receives, without adding a Lambda in between. The result must be valid for the target, so remember that unquoted placeholders are inserted as raw JSON.

Take quiz
What does an input path do?
Extracts values from the event into variables
Selects which bus receives the event
Sets the retry attempts for the target
Why use an input transformer?
To compress events for archiving
To shape the payload for a target without extra code
To authenticate API destinations

21. What are the key EventBridge quotas to know?

Exact numbers differ by Region and many are adjustable in Service Quotas, so check the current values before you design around them. These are the ones that come up most often.

Limit Typical default
Event size 256 KB per entry
Entries per PutEvents request 10
Targets per rule 5
Retry window for a failed delivery Up to 24 hours or 185 attempts
Rules per event bus A few hundred, adjustable

The 256 KB cap pushes large payloads to S3 with the event carrying a pointer (the claim-check pattern). The five-target cap is why fan-out to many consumers often uses SNS or several rules.

Take quiz
What is the maximum size of one event entry?
4 KB
256 KB
64 MB
How many targets can a rule have by default?
1
50
5

22. What is the difference between EventBridge and SNS?

Both fan events out to multiple consumers, but they are tuned for different jobs. SNS is a high-throughput, low-latency pub/sub service. EventBridge is a content-based event router with a much richer ecosystem.

SNS EventBridge
Topics with subscriber filter policies Buses with rules and rich event patterns
Very high throughput, latency in tens of milliseconds Latency typically around half a second
Delivers to SMS, email, mobile push, HTTP, SQS, Lambda Delivers to many AWS services, other buses, API destinations
No archive or replay Archive, replay, schema registry
Receives only what you publish Also receives AWS service and SaaS partner events

Pick SNS for high-volume notifications and human-facing channels. Pick EventBridge for routing domain events and reacting to AWS or SaaS events. They also combine well, for example a rule targeting an SNS topic.

Take quiz
Which service can deliver SMS and mobile push directly?
EventBridge
Both identically through rules
SNS
Which natively receives events from AWS services and SaaS partners?
EventBridge
SNS
Neither, you must publish them yourself

23. What is the difference between EventBridge and SQS?

SQS is a queue, and EventBridge is a router. SQS stores messages until a consumer pulls and deletes them. EventBridge pushes events to targets as they match and does not hold them for consumers.

SQS EventBridge
Pull model, consumers poll Push model, targets are invoked
Buffers messages up to 14 days Retries failed delivery for up to 24 hours
Competing consumers share one stream of work Every matching rule receives its own copy
No content-based routing Content-based routing with event patterns

The usual design puts them together: a rule routes events to an SQS queue so each consumer gets buffering, back-pressure and its own dead-letter queue.

Take quiz
Which one lets consumers pull at their own pace?
SQS
SNS filter policies
EventBridge rules
A common way to combine them is to:
Archive the queue into an event bus
Route events from a rule into an SQS queue
Replace the queue with a scheduled rule

24. When should you choose EventBridge over Kinesis Data Streams?

Choose EventBridge when you have discrete business or infrastructure events that should be routed by content to different targets. Choose Kinesis when you have a continuous, high-volume stream where order and position matter.

Need Better fit
Route OrderPlaced to billing and email differently EventBridge
React to AWS service state changes EventBridge
Ordered records per partition key Kinesis
Multiple consumers reading by offset, re-reading old data Kinesis
Millions of clickstream records per second Kinesis

They are not exclusive. EventBridge Pipes can read from a Kinesis stream, filter it and push selected records to a bus.

Take quiz
Which workload suits Kinesis rather than EventBridge?
Routing a SaaS webhook event
Ordered clickstream records per partition key
Reacting to an EC2 state change
What can bridge a Kinesis stream into EventBridge?
An archive
The Schema Registry
EventBridge Pipes

25. How does EventBridge match events against rule patterns?

EventBridge compares the event's JSON to each rule's pattern field by field. All listed fields must match, and values in one array are OR-ed. Matching is on the JSON as sent, so a string "100" does not match a number 100.

Beyond exact values you can use content filters:

Operator Example
prefix {"prefix": "order-"}
suffix {"suffix": ".png"}
anything-but {"anything-but": ["TEST"]}
numeric {"numeric": [">", 100]}
exists {"exists": true}
cidr {"cidr": "10.0.0.0/24"}
wildcard, equals-ignore-case {"wildcard": "eu-*"}

The $or operator combines conditions across different fields. Use it sparingly, because very complex patterns are hard to review.

Take quiz
Which operator matches only when a field is present?
prefix
cidr
exists
Pattern {"detail":{"qty":[{"numeric":[">",100]}]}} matches an event whose qty is:
The number 150
Exactly 100
The string "150" only

26. What happens when multiple rules match the same event?

Each matching rule fires independently, and the event is delivered to every target of every matching rule. There is no priority, no first-match-wins, and no ordering between rules.

That is what makes fan-out simple: add another rule and a new consumer starts receiving the same events. It is also why overlapping patterns can cause surprises, especially if two rules point at the same target and it receives the event twice.

If you want an exclusive path, write patterns that cannot overlap, for example by using anything-but on the catch-all rule.

Take quiz
An event matches two rules. What happens?
Both rules deliver the event to their targets
Only the oldest rule fires
EventBridge rejects the event as ambiguous
How do you prevent a catch-all rule from also firing?
Raise the rule's priority number
Make the patterns non-overlapping, for example with anything-but
Disable the default bus

27. Explain the execution flow of an event from PutEvents to a target?

The producer calls PutEvents and EventBridge authenticates the request and checks IAM or the bus resource policy. The event is accepted onto the bus and then evaluated against every rule on that bus.

sequenceDiagram
  participant P as Producer
  participant B as Event bus
  participant R as Rules
  participant T as Target
  participant D as DLQ
  P->>B: PutEvents
  B->>R: Evaluate patterns
  R->>T: Transform input and deliver
  alt delivery fails
    R->>T: Retry with backoff
    R->>D: Send after retries are exhausted
  end
  1. Matching rules apply their input transformer or input path.
  2. EventBridge invokes each target with the rule's role or the target's resource policy.
  3. On failure it retries according to the retry policy.
  4. If a dead-letter queue is set, the failed event goes there, otherwise it is dropped.
Take quiz
What happens right after PutEvents is accepted?
It is written to a queue waiting for a consumer to poll
The event is evaluated against the rules on that bus
It is copied to every bus in the account
Where does an event go after retries are exhausted and a DLQ is configured?
To the archive automatically
Back onto the bus as a new event
To the dead-letter queue

28. How does EventBridge handle retries and failed deliveries?

When a target call fails with a retriable error, EventBridge retries with exponential backoff and jitter. By default it keeps trying for up to 24 hours and up to 185 attempts, whichever limit comes first.

You can tune this per target with a retry policy: MaximumEventAgeInSeconds from 60 to 86400 and MaximumRetryAttempts from 0 to 185. Some errors, such as a deleted target or missing permission, are not worth retrying and fail quickly.

If delivery still fails and no dead-letter queue is set, the event is dropped. For Lambda, EventBridge considers the delivery complete once Lambda accepts the async invocation, so function failures are handled by Lambda's own retries and destinations.

Take quiz
What are the default retry limits for a target?
Three attempts over five minutes
Unlimited attempts until success
Up to 24 hours or 185 attempts
What happens to a failed event with no DLQ configured?
It is dropped after retries end
It is replayed automatically each hour
It is stored on the bus indefinitely

29. How do you configure a dead-letter queue for an EventBridge target?

Set a DeadLetterConfig on the target, not on the rule, pointing to a standard SQS queue. Then give EventBridge permission to send messages to it.

{
  "Sid": "AllowEventBridgeToSendToDLQ",
  "Effect": "Allow",
  "Principal": { "Service": "events.amazonaws.com" },
  "Action": "sqs:SendMessage",
  "Resource": "arn:aws:sqs:us-east-1:111122223333:orders-dlq",
  "Condition": { "ArnEquals": { "aws:SourceArn": "arn:aws:events:us-east-1:111122223333:rule/orders-bus/order-paid" } }
}

FIFO queues are not supported as the DLQ. Failed messages arrive with attributes such as ERROR_CODE and ERROR_MESSAGE, which makes triage much easier. Alarm on the queue depth so failures do not sit unnoticed.

Take quiz
Where is the dead-letter queue configured?
On the individual target
On the event pattern
On the event bus
Which queue type can be used as an EventBridge target DLQ?
A FIFO SQS queue
A standard SQS queue
A Kinesis stream

30. Why doesn't EventBridge guarantee ordering or exactly-once delivery?

EventBridge is a distributed, highly available service that favours durability and scale over strict ordering. It delivers at least once, so a target can occasionally see the same event twice, and events can arrive out of order.

Retries make this worse. If event A fails and is retried while event B succeeds, B reaches the target first. Replays and overlapping rules add more duplicates.

Design for it instead of fighting it: make consumers idempotent, carry a sequence number or timestamp in detail when order matters, and use Kinesis or SQS FIFO when strict ordering is a hard requirement.

Take quiz
EventBridge delivers events:
Exactly once, always
At least once
At most once, never retried
What is the right response to possible duplicates?
Move all events to the default bus
Disable retries on all targets
Make consumers idempotent

31. How do you make EventBridge consumers idempotent?

Give every business operation a stable key and make the handler safe to run twice. The EventBridge id works for deduplicating redeliveries, but a business key such as orderId also covers a producer that publishes the same fact twice.

  1. Read the key from the event, for example detail.orderId plus event type.
  2. Do a conditional write to a store, like a DynamoDB PutItem with attribute_not_exists.
  3. If the write fails because the key exists, skip the work and return success.
  4. Expire old keys with a TTL.

Powertools for AWS Lambda has an idempotency utility that does this with a DynamoDB table. Side effects that are naturally idempotent, such as setting a status to PAID, need no extra guard.

Take quiz
Which DynamoDB feature enforces first-write-wins for dedup keys?
A global secondary index scan
DynamoDB Streams alone
A conditional write with attribute_not_exists
Why also use a business key and not only the event id?
A producer may publish the same fact twice with different event ids
Event ids are always identical on redelivery
The event id cannot be read by Lambda

32. How do you deliver EventBridge events to a FIFO SQS queue?

Add the FIFO queue as a rule target and set the MessageGroupId in the target's SQS parameters. The group ID is mandatory for FIFO queues. Use a static value, or take it from the event with an input path such as $.detail.customerId.

{
  "Id": "fifo-target",
  "Arn": "arn:aws:sqs:us-east-1:111122223333:orders.fifo",
  "SqsParameters": { "MessageGroupId": "orders" }
}

The queue then preserves the order of messages it receives within each group. It cannot restore the order in which events were originally published, since EventBridge itself does not guarantee ordering. Also plan deduplication, for example by enabling content-based deduplication when identical payloads should be treated as duplicates.

Take quiz
What must be set when targeting a FIFO queue?
MessageGroupId
A cron expression
VisibilityTimeout of 0
What does a FIFO queue not fix?
Message retention
Out-of-order arrival from EventBridge itself
Ordering within a message group on the queue

33. How does cross-account event delivery work in EventBridge?

Cross-account delivery is bus to bus. A rule in the source account targets the event bus in the destination account, and the destination bus allows it through a resource-based policy.

flowchart LR
  A["Account A bus"] -->|rule with bus target| B["Account B bus"]
  B --> C["Rules in Account B"]
  C --> D[Targets]
  1. In Account B, attach a bus policy that allows events:PutEvents from Account A, or from an AWS Organization using aws:PrincipalOrgID.
  2. In Account A, create a rule whose target is Account B's bus ARN, with an IAM role allowed to call PutEvents on it.
  3. In Account B, write rules that route the received events to local targets.

Account B pays for the events it receives as custom events, so agree on volume with the owning team first.

Take quiz
What allows Account A to send events to Account B's bus?
A shared Lambda layer
A resource-based policy on Account B's bus
A VPC peering connection
How can the policy cover a whole AWS Organization?
By enabling archive on the bus
By adding a wildcard to the event pattern
With the aws:PrincipalOrgID condition key

34. How does cross-Region event routing work in EventBridge?

A rule in one Region can target an event bus in another Region, using the same bus-as-target feature as cross-account routing. EventBridge uses an IAM role to call PutEvents on the destination bus.

Typical uses include aggregating events from many Regions into a central bus for security analysis, or copying events to a second Region for disaster recovery.

Remember that rules and targets are Regional. A Lambda in us-east-1 cannot be a direct target of a bus in eu-west-1, so route through a bus in each Region. Cross-Region delivery adds latency and is billed per forwarded event.

Take quiz
How do you send events to a bus in another Region?
Enable a global archive
Create the same bus name and hope they sync
Use that bus as a rule target
Why route through a bus in each Region?
Rules and targets are Regional resources
Targets only work with the default bus
Buses cannot receive events from IAM roles

35. How do EventBridge global endpoints improve availability?

A global endpoint pairs a primary and a secondary Region so event ingestion fails over automatically if the primary has a problem. Producers publish to the endpoint instead of a single Region's bus.

  1. Create identically named buses with the same rules in both Regions.
  2. Create the global endpoint with a Route 53 health check, usually driven by a latency metric alarm.
  3. Optionally turn on event replication so events are copied to the secondary bus.
  4. Publish with an SDK that supports SigV4A signing, passing the endpoint ID.

When the health check goes unhealthy, new events flow to the secondary Region. Consumers must therefore exist and be tested there, and idempotency matters even more because events can be replicated.

Take quiz
What triggers failover for a global endpoint?
A Route 53 health check
A change to the event pattern
A manual archive replay
What must exist in both Regions?
A shared dead-letter queue
Matching buses and rules
Identical Lambda concurrency limits only

36. What is the difference between EventBridge Scheduler and scheduled rules?

Both can fire on a schedule, but Scheduler is the newer, more capable service and AWS recommends it for new work.

Scheduled rules EventBridge Scheduler
Default bus only Its own service with schedule groups
UTC only Time zones and daylight saving
Rate and cron One-time at(), rate and cron
Limited set of targets Universal targets covering most AWS APIs
Counts against rule quotas Built for millions of schedules
No flexible window Flexible time window to spread load

Keep scheduled rules only where they already exist and work. For per-customer reminders, timeouts and one-off jobs, use Scheduler.

Take quiz
Which supports time zones and daylight saving?
Scheduled rules
EventBridge Scheduler
Neither of them
Which fits one million per-customer reminders better?
A Lambda looping every minute
Scheduled rules on the default bus
EventBridge Scheduler

37. What is the difference between EventBridge Pipes and EventBridge rules?

A rule sits on a bus and fans one event out to up to five targets, matching by content. A pipe connects exactly one source to one target and also polls that source for you.

Rules on a bus Pipes
Events are pushed in by producers Pipes polls SQS, Kinesis, DynamoDB Streams, Kafka, MQ
One event to many targets One source to one target
No built-in enrichment step Optional enrichment before the target
Decoupled, anyone can add a consumer Tightly coupled by design

Use a pipe to move queue or stream records to a target with light filtering and enrichment. Use a bus and rules when many independent consumers should react to the same event.

Take quiz
Which one polls a source such as an SQS queue for you?
A rule on the default bus
A global endpoint
EventBridge Pipes
When is a bus with rules the better choice?
When many independent consumers should receive the same event
When you need to poll a Kafka topic
When exactly one source feeds one target

38. How do API destinations handle authentication and rate limiting?

Authentication lives in a connection. EventBridge supports basic authentication, API key headers and OAuth client credentials, and stores the secrets in AWS Secrets Manager. For OAuth it fetches and refreshes tokens automatically.

Rate limiting is set on the API destination as an invocation rate limit per second. Events beyond that rate are held and retried instead of overwhelming the endpoint.

EventBridge treats 429 and 5xx responses as retriable and honours a Retry-After header when present. Other 4xx responses are not retried. Pair it with a dead-letter queue so rejected events can be inspected.

Take quiz
Where are API destination credentials stored?
In AWS Secrets Manager through the connection
In the rule's description
In the event detail
Which response is treated as retriable?
HTTP 401 on every call
HTTP 429
HTTP 404 on every call

39. How do you secure an Amazon EventBridge event bus?

Security is layered, from who can publish to who can read the data.

  • IAM policies restrict who can call PutEvents and who can create or change rules.
  • Bus resource policies restrict cross-account senders, ideally with aws:PrincipalOrgID or specific account IDs, never a bare wildcard principal.
  • Least-privilege roles for each rule target, scoped to the exact resource.
  • KMS customer managed keys to encrypt events at rest on the bus.
  • Interface VPC endpoints so private workloads can publish without internet access.
  • CloudTrail to audit rule changes and publishers.

Also keep sensitive fields out of events. Send an identifier and let the consumer fetch the data it is entitled to see.

Take quiz
What is the safest way to allow a whole organisation to publish to a bus?
Sharing one IAM user's keys
A bus policy using aws:PrincipalOrgID
A policy with Principal set to * and no conditions
Which feature lets private workloads publish without an internet route?
A public NAT-free event pattern
A partner event source
An interface VPC endpoint

40. How does EventBridge react to AWS API calls through CloudTrail?

Management API calls recorded by CloudTrail are delivered to the default bus as events with detail-type AWS API Call via CloudTrail. You match them on detail.eventSource and detail.eventName.

{
  "source": ["aws.ec2"],
  "detail-type": ["AWS API Call via CloudTrail"],
  "detail": {
    "eventSource": ["ec2.amazonaws.com"],
    "eventName": ["TerminateInstances"]
  }
}

This is a convenient way to alert on risky changes, tag new resources automatically, or trigger remediation. Data events, such as S3 object-level activity, need a CloudTrail trail that records them. Global-service events such as IAM are emitted in us-east-1, so create the rule there.

Take quiz
Which detail-type identifies CloudTrail-based events?
CloudTrail Digest Notification
EC2 Instance State-change
AWS API Call via CloudTrail
Where do IAM API call events show up?
In us-east-1
Only on partner buses
In every Region at once

41. How do you monitor EventBridge with CloudWatch metrics?

EventBridge publishes metrics under the AWS/Events namespace, usually dimensioned by RuleName and EventBusName.

Metric What it tells you
MatchedEvents Events that matched a rule
TriggeredRules Rules that fired
Invocations Target invocation attempts
FailedInvocations Targets that could not be delivered to after retries
ThrottledRules Rules throttled by service limits
InvocationsSentToDlq / InvocationsFailedToBeSentToDlq DLQ handling outcomes
IngestionToInvocationStartLatency Delay from ingestion to delivery start

Alarm on FailedInvocations, on InvocationsFailedToBeSentToDlq, and on the DLQ's queue depth. A CloudWatch Logs target on a debug rule is a handy way to see the actual events.

Take quiz
Which metric shows delivery failures to targets?
FailedInvocations
TriggeredRules
MatchedEvents
Which namespace holds EventBridge metrics?
Custom/EventBridge
AWS/Events
AWS/EventBus

42. How do you test an event pattern before deploying a rule?

Use the console's sandbox or the TestEventPattern API. Both take a pattern and a sample event and tell you whether it matches, with no rule or target needed.

aws events test-event-pattern \
  --event-pattern file://pattern.json \
  --event file://event.json

The sample event must include the full envelope (id, account, source, time, region, resources, detail-type and detail), otherwise the test will not behave like a real event.

For an end-to-end check, publish a sample to a dev bus with put-events and attach a temporary CloudWatch Logs target to the rule. Keep both the pattern and sample events in version control.

Take quiz
What does TestEventPattern need as input?
A rule ARN and a target ARN
A pattern and a sample event
An archive name and a replay window
What is a quick way to see matched events during testing?
Create a second archive
Enable schema discovery on a partner bus
Attach a temporary CloudWatch Logs target

43. How do you troubleshoot an EventBridge rule that is not triggering?

Work from the producer to the target and check each hop.

  1. Producer: was the event published to the right bus and Region? Check FailedEntryCount from PutEvents, and remember that custom sources cannot start with aws..
  2. Rule: is it enabled and attached to that bus?
  3. Pattern: test it against the real event. Common culprits are case, arrays, nested detail paths, and string versus number types.
  4. Metrics: MatchedEvents without Invocations means the pattern worked but delivery did not. No MatchedEvents means the pattern, bus or producer is wrong.
  5. Permissions: the target resource policy or the rule's IAM role.
  6. DLQ and logs: read the DLQ error attributes and the target's own logs.

Adding a CloudWatch Logs target with the same pattern is the fastest way to see exactly what arrived.

Take quiz
MatchedEvents is high but Invocations is zero. What does this suggest?
The pattern never matched anything
The producer is publishing to the wrong Region
The pattern works but delivery to the target is failing
Which PutEvents result detail should you check first?
FailedEntryCount
Size of the Lambda deployment package
Time zone of the producer

44. Why should you use a custom event bus instead of the default bus?

The default bus carries AWS service events and is often already shared by many teams. A custom bus gives you a clean boundary for your own domain events.

  • Isolation: one bus per domain or team keeps patterns simple and blast radius small.
  • Access control: each bus has its own resource policy, so you can grant a partner account access to one bus only.
  • Archive and replay: archives are per bus, so you replay one domain without touching others.
  • Schema discovery: turn it on for a single bus rather than for mixed traffic.
  • Clarity: your events are not mixed with CloudTrail and service events.

Scheduled rules still need the default bus, and rules for AWS service events usually live there too.

Take quiz
Why does a custom bus help with access control?
Each bus has its own resource policy
Custom buses ignore IAM
They disable cross-account sending
Which feature still requires the default bus?
Cross-account delivery
Legacy scheduled rules
Event archives

45. How do you design event schemas for versioning in EventBridge?

Treat each event type as a public contract. Keep changes additive so existing consumers continue to work, and make consumers tolerant by ignoring fields they do not know.

  • Use a clear detail-type in the past tense, like OrderPlaced.
  • Put a schemaVersion field in detail, for example "1.2".
  • Adding an optional field is a minor change. Renaming or removing a field is a breaking change.
  • For breaking changes, publish a new type such as OrderPlaced.v2 and run both until consumers migrate.
  • Keep payloads small and send IDs plus the minimum data. Use the claim-check pattern for large payloads.

Use the Schema Registry to document each version and generate code bindings, and add contract tests so a producer change cannot silently break a consumer.

Take quiz
Which change is safe for existing consumers?
Changing a number to a string
Adding an optional field
Renaming an existing field
How do you handle a breaking change?
Delete the archive first
Overwrite the old schema in place
Publish a new event type or version and run both for a while

46. When would you choose Step Functions as an EventBridge target?

Choose it when handling the event takes several steps, needs branching, waits, retries or compensation. A single Lambda is enough for one short step, but it becomes awkward when it grows into a chain of calls.

Use Lambda directly when Use Step Functions when
One short, simple action Multiple ordered steps
No long waits Waiting for callbacks or human approval
Error handling is trivial You need per-step retries and a saga with compensation
No need to see progress You want a visual execution history

A rule starts the state machine with the event as input. The state machine can then call services directly, so you often write less code than with a chain of Lambdas. Express workflows suit high-volume short jobs, and Standard workflows suit long-running ones.

Take quiz
Which scenario justifies Step Functions as the target?
Copying one small object
Writing one log line
A multi-step order fulfilment with compensation on failure
What does the rule pass to the state machine?
The matched event as the execution input
A copy of the entire bus
Only the rule name

47. What is the difference between choreography and orchestration in EventBridge?

In choreography, services react to events independently and nobody is in charge. In orchestration, one coordinator, usually Step Functions, tells each step what to do and tracks the overall result.

Choreography Orchestration
Services publish and subscribe via the bus A workflow calls services in order
Loose coupling, easy to add consumers Tighter coupling, clear control flow
Flow is implicit, harder to trace Flow is explicit and visible
Failure handling is spread across services Central retries and compensation

A common rule of thumb is choreography between bounded contexts and orchestration inside one service's business process. Use correlation IDs in events so choreographed flows can still be traced.

Take quiz
Which style uses a central coordinator?
Orchestration
Event archiving
Choreography
Where does choreography fit best?
Inside a single multi-step transaction needing central rollback
Between independent services or bounded contexts
Only for scheduled jobs

48. How can you optimize EventBridge cost and performance?

Custom events are billed per million published, in 64 KB chunks, while AWS service events on the default bus are free. Most savings come from sending less and filtering earlier.

  • Keep events small so each one stays within a single 64 KB billing chunk.
  • Batch up to 10 entries per PutEvents call and handle partial failures.
  • Write precise patterns so consumers get only what they need, and avoid duplicate rules.
  • Archive only what you will replay, with a pattern and a retention period.
  • Use Pipes filtering to avoid invoking expensive enrichment or targets.
  • Use Scheduler instead of a Lambda that polls on a timer.
  • Watch cross-account and cross-Region forwarding, since each hop is billed.

For performance, back off on throttling, request quota increases early, and keep targets fast or buffered behind SQS.

Take quiz
How are custom events billed?
Per byte of event detail only
Per million events, in 64 KB chunks
A flat monthly fee per bus
Which change reduces unnecessary invocations?
Adding more targets to every rule
Turning on schema discovery everywhere
Writing more precise event patterns

49. How do you define an EventBridge rule in CloudFormation?

Use AWS::Events::Rule with the bus name, an EventPattern and a list of Targets. Remember a separate permission resource for Lambda targets.

OrderPaidRule:
  Type: AWS::Events::Rule
  Properties:
    EventBusName: !Ref OrdersBus
    EventPattern:
      source: ["com.shop.orders"]
      detail-type: ["OrderPaid"]
    Targets:
      - Id: ProcessOrder
        Arn: !GetAtt ProcessOrderFn.Arn
        RetryPolicy:
          MaximumRetryAttempts: 5
          MaximumEventAgeInSeconds: 3600
        DeadLetterConfig:
          Arn: !GetAtt OrdersDlq.Arn

ProcessOrderPermission:
  Type: AWS::Lambda::Permission
  Properties:
    FunctionName: !Ref ProcessOrderFn
    Action: lambda:InvokeFunction
    Principal: events.amazonaws.com
    SourceArn: !GetAtt OrderPaidRule.Arn

In CDK the equivalent is events.Rule with targets.LambdaFunction, which creates the permission automatically. SAM offers an EventBridgeRule event source on a function.

Take quiz
Which resource defines a rule in CloudFormation?
AWS::EventBridge::Router
AWS::SNS::Rule
AWS::Events::Rule
What else is needed for a Lambda target in plain CloudFormation?
An AWS::Lambda::Permission for events.amazonaws.com
A second event bus
A VPC endpoint

50. How would you design a resilient event-driven order system with EventBridge?

Publish domain events to a dedicated custom bus, give each consumer its own queue, and design for duplicates, failures and replay from day one.

flowchart LR
  O["Order service"] -->|PutEvents| B[orders-bus]
  B -->|rule| Q1["Payment queue"]
  B -->|rule| Q2["Inventory queue"]
  B -->|rule| Q3["Email queue"]
  Q1 --> L1["Payment Lambda"]
  Q2 --> L2["Inventory Lambda"]
  Q3 --> L3["Email Lambda"]
  Q1 -.-> D[DLQs]
  B -.-> AR[Archive]
  1. Producers retry PutEvents and check FailedEntryCount. For stronger guarantees, write the event and an outbox row in one DynamoDB transaction and publish from there.
  2. One rule per consumer routes into an SQS queue for buffering and back-pressure, each with a DLQ and retry policy.
  3. Consumers are idempotent, using the order ID as the dedup key.
  4. Multi-step flows like payment and inventory reservation run as a Step Functions saga with compensations.
  5. An archive on the bus allows replay after a bug fix, scoped to the repaired rule.
  6. Global endpoints give regional failover when the business needs it.
  7. Alarms on FailedInvocations, DLQ depth and consumer age make failures visible.

Events stay small and carry IDs, with a schemaVersion and a correlation ID so a single order can be traced across services.

Take quiz
Why put an SQS queue between a rule and a consumer?
To buffer load and give each consumer its own retries and DLQ
Because rules cannot target Lambda
To guarantee global ordering
What lets you rerun a repaired consumer on past orders?
Doubling the retry attempts
An archive and a replay scoped to its rule
Disabling the default bus
«
»

Comments & Discussions