Topic lessonTopic: Designing event-driven processing
Amazon EventBridge: how rule matching and target delivery work
An EventBridge event bus checks incoming events against rules and sends matching events to their configured targets. Follow a fictional image conversion request from arrival at the bus through a rule match, target delivery and successful processing.
Read a sample event and pattern, distinguish a mismatch from failed delivery or failed processing, and identify the evidence to check at each stage.
An event is data about something that happened. Knowing that an SQS queue holds work for a consumer helps distinguish a queue from an event bus. This lesson covers the default event bus and Classic event buses that use rules, with fixed examples that require no live AWS access.
An event bus directs matching events to their targets
The intake service publishes an event. The bus takes in that event, the rule compares it to an event pattern, and the target receives matching events. In some configurations one event can match multiple rules.
- Intake service → Event busSend the event
- Event bus → Conversion ruleCompare the incoming data
- Conversion rule → Conversion queueDeliver on a match
- Intake service
- Publishes an intake event
- Event bus
- Receives the event
- Conversion rule
- Matches the source and event type
- Conversion queue
- Receives the request as the target
Read a match across the source and event type
{
"source": [
"example.image-intake"
],
"detail-type": [
"Image accepted"
]
}The pattern has two fields. An event matches if its source is example.image-intake and its event type is Image accepted. In the table, A matches. B and C each differ on one field.
| Input | source | detail-type | Match result |
|---|---|---|---|
| A | example.image-intake | Image accepted | Matches. EventBridge can attempt delivery to the configured target. |
| B | example.image-intake | Image rejected | Does not match this rule because the event type differs. |
| C | example.batch-import | Image accepted | Does not match this rule because the source differs. |
A total count cannot tell you whether to widen the pattern. Compare intake records with available bus evidence, including the actual event values, the bus that received the event and the type the rule expects. A broader rule could send unintended B or C inputs to downstream processing.
After a match, distinguish target delivery from processing
A rule can match even when the target fails to accept the event. For retryable delivery errors, EventBridge follows the target retry policy. A higher attempt limit alone may leave a permission problem unresolved.
A target dead-letter queue in EventBridge can capture events that failed to reach the target. A dead-letter queue configured for an SQS source queue can isolate messages based on their receive count. Both mechanisms can use SQS queues. Check which system put the event or message there and where the failure occurred.
| Confirmed so far | What to compare next | Decision |
|---|---|---|
| The event reached the bus | Source, event type and rule pattern | Verify the input and match result. |
| The rule matched, but target delivery failed | Target, permissions and failed-delivery evidence, including the DLQ if configured | Identify the cause before choosing a recovery action. |
| The queue accepted the request | The matching consumer record, the stored result and duplicate handling | Assess delivery and conversion separately. |
Choose the evidence that follows from each stage
Choose an option to see the result and explanation.
Check, then explain in your own words
- Compare the actual source and event type against the values expected by the rule.
- For a failed delivery after a match, check the target and its permissions.
- After the queue accepts the request, check the consumer records and business result for that request.
Check your understanding: Delivery to the conversion queue succeeded, but the image is missing. Where should you look first?
Check the consumer’s processing records and where it saves the output.
Delivery to the queue is already confirmed. Use the same request to trace when conversion began, where it failed or where the result was stored.
Sources and conditions checked
The official references used in this lesson are collected here with their scope, conditions and corresponding sections. Independent expert review and live AWS comparison have not been performed.
Scope and conditionsDefault and Classic event buses route matching events to the targets specified by a rule.
Used in this lessonAn event bus directs matching events to their targets Read a match across the source and event type After a match, distinguish target delivery from processing
Scope and conditionsPattern matching compares the event fields and values. The lesson uses exact string matches in a fixed example.
Used in this lessonRead a match across the source and event type
Scope and conditionsRetryable target-delivery errors and the configured age and attempt limits.
Used in this lessonAfter a match, distinguish target delivery from processing
Scope and conditionsRule target dead-letter queues for failed delivery and the difference from failures during SQS message processing.
Used in this lessonAfter a match, distinguish target delivery from processing
Scope and conditionsThe resource that receives events matching a rule, and the permissions needed for delivery.
Used in this lessonAn event bus directs matching events to their targets After a match, distinguish target delivery from processing
Scope and conditionsIsolating unsuccessful messages, FIFO ordering risk and the different Standard/FIFO retention clock origins. No recovery of real business data verified.
Used in this lessonAfter a match, distinguish target delivery from processing