Sub topic 3
Permissions, reliability, and operations
Assume you know JSON, basic IAM policies, AWS regions, and at least one target service such as Lambda or SQS. EventBridge permissions use two main mechanisms:
- A resource policy is attached to a resource, such as an event bus. It controls which principals may send events to that resource.
- An execution role is an IAM role that EventBridge assumes to call a target API. The role must trust
events.amazonaws.comand allow only the required action.
For example, a rule targeting a cross-account event bus may use a role that allows events:PutEvents on the destination bus. Lambda and SQS can also require resource-based policies that allow EventBridge to invoke or send to them.
Retries and dead-letter queues
A target configuration can set MaximumRetryAttempts and MaximumEventAgeInSeconds. EventBridge retries delivery failures until one limit is reached. A dead-letter queue, or DLQ, stores events that could not be delivered. Use an SQS DLQ, monitor it, and include enough event context to diagnose the failure.
A successful PutEvents API call does not guarantee that every entry succeeded. Check FailedEntryCount and inspect individual entries for ErrorCode and ErrorMessage.
> callout warning > Give the EventBridge service and target roles only the actions and resources they need. A DLQ improves recovery, but it does not replace monitoring or fixing the target.
Testing and monitoring
Run aws events test-event-pattern with a sample event before attaching a rule. Then monitor the rule and target with CloudWatch metrics such as matched events, failed invocations, and retry counts. Log target errors and alert when DLQ messages appear.
Cross-account and cross-region routing
The destination event bus needs a resource policy allowing the source account to call events:PutEvents. The source rule needs a target role with permission to publish to the destination bus. Cross-region delivery requires a target bus ARN in the other region. Keep account IDs, regions, and bus names explicit to avoid routing to the wrong environment.
Archive, replay, and schemas
An EventBridge archive stores matching events for a retention period. Replay sends archived events back through a selected bus, allowing recovery or retesting. Plan for duplicate processing because consumers may receive an event again.
The schema registry stores event structures. Schema discovery can infer schemas from events, helping developers generate bindings and detect incompatible changes.
Scheduled invocations
A scheduled rule invokes a target on a rate or cron expression. For new workloads, EventBridge Scheduler provides richer scheduling features, including time zones, one-time schedules, flexible time windows, and retry settings. Use the least-privileged Scheduler execution role.
Exercise
A rule matches events, but its SQS target fails and no message reaches the DLQ. What should you check first?
Show answer
Check the target execution permissions, the DLQ ARN and permissions, the retry configuration, and CloudWatch failure metrics.