What Is Amazon EventBridge? Event Bus, Rules and Schedules Explained
Your shop has a doorbell, a WhatsApp group, and a wall calendar. Amazon EventBridge is all three for AWS: something happened (doorbell), rules decide who to wake (WhatsApp), and Scheduler rings the calendar on time.
In this chapter
- Why event-driven beats polling forever
- Default bus vs custom bus vs partner bus
- Rules, targets, content filters, Scheduler
- EventBridge vs SQS vs cron on EC2
- Lab, errors, FAQ, interview
1. Everyday example first
A hospital LIS uploads a lab report to S3. Billing, SMS, and the doctor app all need to know. Polling S3 every minute wastes money and is late. One event, many targets.
Amazon EventBridge is a serverless event bus. Producers put events on a bus; rules match fields and send to targets (Lambda, SQS, Step Functions, API Destination, and more). EventBridge Scheduler fires one-time or recurring schedules without managing servers.
2. Buses and rules
An ordering app may need to tell inventory and a receipt service about the same order. The publisher sends an event, a record of something that happened. Include a stable source, a type such as OrderPlaced, and details such as the order ID. The event goes onto a bus. Each rule tests the event against a pattern and can send a match to its own target. Draw two matching rules for the same event. The app sends once, then the bus can route to both; it does not have to make a direct call to each consumer.
| Piece | Meaning | When |
|---|---|---|
| Default bus | AWS service events land here | S3, EC2, CloudTrail patterns |
| Custom bus | Your app events, isolated | SaaS product domain events |
| Partner bus | SaaS partners push in | Zendesk, Auth0 style sources |
| Rule | Event pattern or schedule → targets | detail-type = OrderPlaced |
| Scheduler | cron / rate / one-time to a target | Nightly report at 2:00 IST |
3. EventBridge vs SQS vs EC2 cron
- SQS: buffer work for one consumer group; great decoupling + retries.
- EventBridge: publish once, fan-out to many heterogeneous targets with filters.
- EC2 cron: old habit; patching and missed runs hurt. Prefer Scheduler.
- Step Functions: use when the reaction itself is a multi-step workflow.
Ravindra Bagale's Tip
Name detail-type and source like APIs: stable strings, version when you break shape.
4. Industries
- Ecommerce: OrderPlaced → inventory, invoice, loyalty, analytics.
- Fintech: PaymentCaptured → ledger, risk, receipt email.
- Edtech: LessonCompleted → certificate Lambda + CRM.
- IoT factory: TemperatureAlarm → SNS + maintenance ticket.
- Gov/citizen apps: ApplicationSubmitted → SLA timers via Scheduler.
5. Filter pattern sketch
Write the filter and the event side by side. If the rule expects detail-type equal to OrderPlaced, a copy named OrderCancelled should fail that pattern. A rule match answers whether the event qualifies. Delivery then depends on the target configuration and permissions. If you need a nightly report even when there are no orders, model that separately as a Scheduler invocation with a defined time zone. That job starts from a clock, while the order rule starts from a matching event.
- Decide source (com.myapp.orders) and detail-type (OrderPlaced).
- Write a rule event pattern for those fields (and maybe amount > 0).
- Add targets: Lambda for fast work, SQS for heavy, SFN for workflows.
- Enable the rule; put a sample event with PutEvents.
- Check metrics: TriggeredRules, Invocations, FailedInvocations.
{
"source": ["com.myapp.orders"],
"detail-type": ["OrderPlaced"],
"detail": {
"amount": [{"numeric": [">", 0]}]
}
}
6. Mini lab: custom bus + rule + Lambda
Keep an expected result for each test event. The matching event should cause the target to record its test order ID. The copy with another event type should produce no such record. If neither appears, confirm the chosen bus and test the pattern first. If the rule matches, check delivery metrics and whether its target can receive the event.
Do this in ap-south-1 (Mumbai) unless your org forbids it. Set a budget alert first.
- Create a custom event bus named lab-orders.
- Create a rule on that bus matching source com.lab.orders.
- Target a tiny Lambda that prints the event.
- aws events put-events with a matching entry.
- Confirm Lambda log in CloudWatch.
Cleanup (stop billing)
- Delete the rule, bus, and lab Lambda.
- Remove any leftover log groups if your org wants.
7. Common errors and fixes
Each row is a real mistake students and juniors hit. Read the fix before you panic.
| Error / symptom | Fix |
|---|---|
| Rule never fires | Pattern too strict or wrong bus; test with matched sample. |
| Infinite Loop warning | Target writes events that rematch the same rule — add filter. |
| PutEvents FailedEntry | Size, detail JSON, or quota — read FailedEntryCount. |
| Scheduler vs Rules cron confusion | One-time/flexible schedules → Scheduler; AWS events → Rules. |
| Target not authorized | EventBridge needs iam:PassRole / resource policy on target. |
| Cross-account delivery fails | Use event bus policy + correct role. |
| Wrong timezone on cron | Scheduler expressions need timezone field for IST. |
| DLQ empty but failures | Confirm the event matched the rule, then check target permissions. If delivery keeps failing and the DLQ stays empty, check whether EventBridge can send to the DLQ and look at InvocationsFailedToBeSentToDlq. |
| Partner bus empty | Partner not enabled / wrong region. |
| High FailedInvocations | Check whether EventBridge could deliver the event to the target. For an asynchronous Lambda target, successful delivery hands the event to Lambda. If the handler later fails, check Lambda logs and its own asynchronous failure destination. |
8. Troubleshooting checklist
- Confirm events land on the bus you think (default vs custom).
- Paste a known-good sample into the rule tester.
- Check CloudWatch metrics on the rule.
- Read Lambda errors if target is Lambda.
- Verify IAM for PutEvents and for the target.
9. FAQ
Q. Is EventBridge the old CloudWatch Events?
Same family; EventBridge adds buses, partners, richer targets.
Q. EventBridge vs SNS?
SNS is pub/sub for notifications; EventBridge is event routing with rich filters and SaaS partners.
Q. Can I archive events?
Yes — archives + replay for recovery drills.
Q. Max targets per rule?
Multiple; design with fan-out limits in mind — see current quotas.
Q. Do I need Schema Registry?
Helpful for teams discovering event shapes.
10. Interview Q&A
Q. What is an event bus?
A channel where producers put events and rules route them to targets.
Q. Default vs custom bus?
Default for AWS services; custom for your domain events.
Q. EventBridge vs SQS?
Bus fan-out with filters vs durable queue for workers.
Q. What is Scheduler for?
One-time or recurring invokes without EC2 cron.
Q. How do you avoid poison loops?
Tighten patterns; never emit the same detail-type from the target carelessly.
Q. Idempotent consumers?
Consumers must tolerate at-least-once delivery.
11. Tips in English, Marathi and Hindi
Ravindra Bagale's Tip (EN)
Stable source and detail-type names are public APIs. Rename carefully.
Ravindra Bagale's Tip (MR)
source व detail-type = public API. नाव बदलताना काळजी.
Tip (HI)
source और detail-type पब्लिक API हैं — नाम बदलते समय सावध रहो।
Try at home
- List 5 events your college app could emit.
- Draw bus → rule → 3 targets on paper.
- Compare one cron job you know with Scheduler.
In short
- EventBridge routes events from producers to many targets.
- Use custom buses for your app domain.
- Scheduler replaces most EC2 cron needs.
- Filter tightly; watch FailedInvocations.
Revision, interview and comparison cards
Revise this lesson in a few minutes. Save the cards on your phone or download them as PNG files. The QR code on each card opens this lesson.











More cards: Ravi Sir's Cards.
Practise this chapter
Interview questions and answers
A rule pattern matches but the target did not write the order ID. What do you investigate?
Verify the publication used the expected bus and the pattern matched. Then check target delivery metrics and permission for the invocation. With asynchronous processing, separately check the receiving function’s logs for failure after acceptance. Locate which stage missed the order before repeating it.
Check your understanding
Choose an answer, then compare your reasoning with the explanation.
Practice Tasks
Practice checks run in your browser. They check the answer for this exercise; they do not create resources or connect to your AWS account.
About this scenarioVidarbha Cotton Mills is a textiles business in Nagpur. Ganesh Wankhede looks after its IT and cloud work. They count money in INR and run their AWS resources in the ap-south-1 Region. In the tasks below you do real jobs for them using what this lesson teaches. All names, account IDs, IP addresses and numbers are made up for practice.
0 / 16
Easy List event buses
See custom buses.
List event buses in ap-south-1.
- Read the task and decide which AWS service it is about.
- Write aws, then the service name, then the operation (the action word).
- Add each needed flag (--name) followed by its value from the task.
- Flags can be in any order. Click Check answer.
Easy Create an event bus
Isolate app events.
Create event bus named vidarbhacotton-orders.
- Read the task and decide which AWS service it is about.
- Write aws, then the service name, then the operation (the action word).
- Add each needed flag (--name) followed by its value from the task.
- Flags can be in any order. Click Check answer.
Easy List rules on a bus
Inventory automation.
List rules on event bus vidarbhacotton-orders.
- Read the task and decide which AWS service it is about.
- Write aws, then the service name, then the operation (the action word).
- Add each needed flag (--name) followed by its value from the task.
- Flags can be in any order. Click Check answer.
Easy Describe a rule
Check schedule and state.
Describe rule vidarbhacotton-nightly on bus default.
- Read the task and decide which AWS service it is about.
- Write aws, then the service name, then the operation (the action word).
- Add each needed flag (--name) followed by its value from the task.
- Flags can be in any order. Click Check answer.
Easy Delete a rule
Clean lab rules.
Delete rule vidarbhacotton-nightly from bus default.
- Read the task and decide which AWS service it is about.
- Write aws, then the service name, then the operation (the action word).
- Add each needed flag (--name) followed by its value from the task.
- Flags can be in any order. Click Check answer.
Easy List targets for a rule
See who receives events.
List targets for rule vidarbhacotton-nightly on bus default.
- Read the task and decide which AWS service it is about.
- Write aws, then the service name, then the operation (the action word).
- Add each needed flag (--name) followed by its value from the task.
- Flags can be in any order. Click Check answer.
Easy Default buses per account/region
Every account has one default.
How many default event buses exist per account per region?
- Write down the numbers the task gives you.
- Work it out step by step on paper.
- Type only the final answer in the box.
- Click Check answer.
Easy rate(5 minutes) number
Schedules use rate or cron.
In rate(5 minutes), what is the number 5?
- Write down the numbers the task gives you.
- Work it out step by step on paper.
- Type only the final answer in the box.
- Click Check answer.
Medium Put a schedule rule
Cron-like triggers.
Put rule vidarbhacotton-nightly on bus default with schedule cron(0 18 * * ? *).
- Read the task and decide which AWS service it is about.
- Write aws, then the service name, then the operation (the action word).
- Add each needed flag (--name) followed by its value from the task.
- Flags can be in any order. Click Check answer.
Medium Put Lambda target on a rule
Wire rule to action.
Put target Id t1 Arn arn:aws:lambda:ap-south-1:108737854657:function:vidarbhacotton-job on rule vidarbhacotton-nightly.
- Read the task and decide which AWS service it is about.
- Write aws, then the service name, then the operation (the action word).
- Add each needed flag (--name) followed by its value from the task.
- Flags can be in any order. Click Check answer.
Medium Put a custom event
Publish domain events.
Put events Entries Source vidarbhacotton.orders DetailType OrderPlaced Detail '{"id":"1"}' EventBusName vidarbhacotton-orders.
- Read the task and decide which AWS service it is about.
- Write aws, then the service name, then the operation (the action word).
- Add each needed flag (--name) followed by its value from the task.
- Flags can be in any order. Click Check answer.
Medium Remove targets from a rule
Must remove targets before delete.
Remove targets t1 from rule vidarbhacotton-nightly on bus default.
- Read the task and decide which AWS service it is about.
- Write aws, then the service name, then the operation (the action word).
- Add each needed flag (--name) followed by its value from the task.
- Flags can be in any order. Click Check answer.
Medium Allow EventBridge to invoke Lambda
Resource policy side.
Allow lambda:InvokeFunction on arn:aws:lambda:ap-south-1:108737854657:function:vidarbhacotton-job from events.amazonaws.com.
- Start with { "Version": "2012-10-17", "Statement": [ ... ] }.
- In each statement write Effect, Action and Resource.
- Give only what the task needs (least privilege).
- Use double quotes and commas correctly. Click Check answer.
Medium EventBridge archive retention days example
Replay needs retention.
If you set archive retention to 30 days, what number do you configure?
- Write down the numbers the task gives you.
- Work it out step by step on paper.
- Type only the final answer in the box.
- Click Check answer.
Hard Event pattern for OrderPlaced
Filter only useful events.
JSON event pattern: source equals myapp.orders and detail-type equals OrderPlaced.
- Start from the top-level keys the task names.
- Indent child keys with 2 spaces (no tabs).
- Fill in each property with the value from the task.
- Click Check answer. Key order does not matter.
Hard Pattern with amount > 1000
Numeric matching for fraud.
Event pattern: source myapp.orders, detail.amount numeric greater-than 1000.
- Start from the top-level keys the task names.
- Indent child keys with 2 spaces (no tabs).
- Fill in each property with the value from the task.
- Click Check answer. Key order does not matter.