What Is an Event?
An event is a JSON document that captures a state change or activity in your environment. Think of it as a structured message with metadata and payload—whenever something happens (for example, a new order is placed), an event is emitted. Example event payload:Events are immutable and timestamped. Use descriptive
detail-type and source fields to simplify filtering.What Is an Event Bus?
An event bus acts as a central router for all your events. AWS EventBridge provides three types of buses:
The event bus handles ingestion, filtering, and routing—abstracting away the need to maintain custom message brokers.
What Is an Event Rule?
An event rule inspects incoming events on a bus against a pattern or schedule. When an event matches, the rule routes it to one or more targets (Lambda functions, SNS topics, SQS queues, Step Functions, etc.). Key features:- Pattern matching: Filter by JSON fields, prefixes, or numeric ranges.
- Scheduled events: Trigger actions on cron or rate-based schedules.
- Multiple targets: Fan out a single event to various downstream services.
How They Work Together
The following table summarizes the roles of each component:E-Commerce Order Processing Workflow
- OrderPlaced event is emitted when a customer completes checkout.
- EventBridge sends the event to the default event bus.
- An event rule filters for
paymentStatus: ["SUCCESS"]. - Matched events trigger a Lambda function that fulfills the order and sends a confirmation email.
Ensure your event rule IAM role has permission to invoke the target service (
lambda:InvokeFunction, sns:Publish, etc.).