Event buses and patterns
An EventBridge event busA router that receives events and sends matches to configured destinations. routes JSON eventsA JSON message that describes an occurrence or change., which are messages describing something that happened, to matching targetsA resource or endpoint that receives a matching event.. A target is the resource or endpoint that receives the event. Think of a Classic bus as a sorting desk: rules select events, then send them to the configured destinations.
How it works
- Choose the bus for the producerA system that sends events to an event bus or pipe., the system sending events. The default bus receives AWS service events. A custom Classic bus separates application traffic, and a partner bus receives events from a software as a serviceAn application hosted and operated by a provider for its customers. (SaaS) provider.
- Create a rule with an event patternA JSON filter describing the fields and values an event must match., a JSON filter over fields such as
source,detail-type, anddetail.state. Required fields must exist at the same nesting level. Omitted fields are ignored. - Test the pattern with
TestEventPattern. - Grant permission to invoke each target. A rule can send matches directly to SNS, Lambda, Step Functions, Systems Manager Automation or Run Command, or an ECS task.
- If the target needs a different message shape, use an input transformerA configuration that selects original event values and inserts them into a target message template.. JSONPathA path expression used to select a value in JSON event data., a path expression that selects a JSON value, extracts fields from the original event into a target template.
AWS API calls reach the default bus as AWS API Call via CloudTrail events only when a trail with logging is enabled. Match detail.eventSource and detail.eventName. S3 object calls also need the trail’s data events, and read-only management events need the rule state ENABLED_WITH_ALL_CLOUDTRAIL_MANAGEMENT_EVENTS.
A schemaA description of the structure of an event. describes an event’s structure. Schema discovery infers schemas from the original events, creates a new version when the structure changes, and offers downloadable code bindingsGenerated programming-language code representing an event schema.. An API destinationAn HTTPS endpoint that EventBridge can invoke for a rule or pipe. sends events to an HTTPS endpoint, with a connectionA configuration holding authorization and connectivity settings for an API destination. that holds its authorization.
The Custom Event Bus model uses subscribers instead of rules. Each subscriber filters events, can transform them, and delivers to one target.
Exam cues
- If the question says react when an EC2 instance stops, think a rule on
aws.ec2withEC2 Instance State-change Notificationanddetail.state, because EC2 publishes that state in the event detail. - If the question says catch a specific API call, think
AWS API Call via CloudTrailwitheventSourceandeventName, because those fields sit insidedetailand need an enabled trail. - If the question says email the team when a pipeline fails, think a rule on
CodePipeline Pipeline Execution State Changewith stateFAILEDand an SNS target. - If the question says route GuardDuty or Security Hub findings to remediation, think a finding pattern with a Lambda, Step Functions, or Systems Manager Automation target.
- If the question says reformat an event for a target without code, think an input transformer, because JSONPath variables fill a target template.
- If the question says call a third-party HTTPS API with credentials, think an API destination with a connection, because it holds the authorization.
Remember
- At most five targets per rule.
- API destination requests time out after five seconds, then follow the retry policy.
- Trusted Advisor and Organizations events arrive in US East (N. Virginia). Trusted Advisor’s built-in emails are weekly.
Trap: A rule that matches CloudTrail API calls receives nothing without a trail that has logging enabled, and S3 object calls also need the trail’s data events.
Trap: Schema discovery sees the original event, not the payload an input transformer sends to the target.
A producer sends an event to the bus.
The rule evaluates its event pattern.
EventBridge invokes the authorized target when the event matches.
Da documentação da AWS (37)
- A rule on an event bus compares arriving events with a pattern and sends matching events to its targets.
- The default bus receives AWS service events; custom Classic buses receive application events; partner buses receive SaaS partner events.
- Custom Event Bus - Classic uses rules and targets, while the Custom Event Bus uses subscribers.
- Each Custom Event Bus subscriber filters events, optionally transforms them, and delivers matching events to one target.
- A rule can have at most five targets.
- An event must contain all pattern fields at the same nesting level; fields omitted from the pattern are ignored.
- The prefix operator matches the beginning of a string.
- The numeric operator compares numeric values and ranges.
- The exists operator tests the presence or absence of a leaf field.
- The anything-but operator excludes specified values.
- TestEventPattern tests whether a supplied event matches an event pattern.
- EC2 sends EC2 Instance State-change Notification events with source aws.ec2 and state in detail.state.
- CloudTrail API events use detail-type AWS API Call via CloudTrail on the default bus and require a trail with logging enabled.
- CloudTrail API events expose eventSource and eventName inside detail for rule matching.
- Matching S3 object API calls through CloudTrail requires a trail configured for the relevant data events.
- Read-only CloudTrail management events require rule state ENABLED_WITH_ALL_CLOUDTRAIL_MANAGEMENT_EVENTS; forwarding them requires that state on both forwarding and receiving rules.
- CodePipeline emits CodePipeline Pipeline Execution State Change events, and rules can select FAILED executions and send SNS notifications.
- GuardDuty publishes findings to EventBridge for automated processing and notification.
- Rules can match source aws.securityhub and detail-type Security Hub Findings - Imported and filter finding attributes.
- Rule targets include SNS, Lambda, Step Functions, Systems Manager Automation, Run Command, ECS tasks, and the EBS CreateSnapshot API.
- An EventBridge rule can run a Systems Manager Command document when an Auto Scaling group creates a managed node.
- EventBridge needs permission to invoke the target resource.
- An input transformer extracts values from the original event using JSONPath and inserts them into a template sent to a target.
- A schema describes event structure; EventBridge can infer schemas and generate downloadable code bindings.
- Schema discovery creates a new schema version when event structure changes.
- Schema discovery infers the original event, not the target payload produced by an input transformer.
- An API destination is an HTTPS endpoint used as a rule or pipe target; its connection defines authorization and connectivity.
- API destination requests time out after five seconds and timed-out requests are retried according to the retry policy.
- CodeDeploy sends CodeDeploy Deployment State-change Notification events with source aws.codedeploy.
- Elastic Beanstalk emits environment health transitions and operation state changes for EventBridge response rules.
- Auto Scaling emits successful and unsuccessful scaling events that EventBridge rules can match.
- Trusted Advisor check status changes can trigger EventBridge targets, and those events are emitted in US East (N. Virginia).
- Trusted Advisor built-in email notifications summarize results weekly.
- Trusted Advisor has a low-utilization EC2 instance check for identifying potential cost savings.
- Organizations activity can trigger EventBridge notification rules in US East (N. Virginia).
- Once EventBridge notifications are turned on for a bucket, S3 sends events such as Object Created to EventBridge, where a rule can start a Step Functions workflow.
- EventBridge reaches CloudWatch Logs targets through resource-based policies, Lambda, SNS and SQS targets through a resource-based policy or an IAM execution role, and Kinesis streams through an IAM role.
Target retries and dead-letter queues
EventBridge retries failed delivery to a rule targetA resource or endpoint that receives a matching event. and can preserve undelivered eventsA JSON message that describes an occurrence or change. in a dead-letter queueA queue that retains events whose delivery failed so they can be processed later. (DLQ), a queue for failures that need later attention. Configure this recovery path on the target.
How it works
- EventBridge tries to invoke the rule target. For a retriable failure, it applies the target retry policy.
- Retries use exponential backoffA retry method that increases the delay between attempts., increasing the wait between attempts, with jitterA randomized delay between retry attempts., a randomized delay. The defaults are up to 24 hours and up to 185 retries.
- Missing permissions or a missing target can bypass retries and go directly to the configured DLQ.
- When retries are exhausted, EventBridge sends the failed event to the target DLQ. Without one, it drops the event.
- Inspect the DLQ message attributes to find the rule, target, error, retry count, and exhausted retry condition. Resolve the cause before processing failures again.
- For a bus using a customer managed KMS keyA KMS key that you create and control, including its access policy., configure a separate bus DLQ for non-retriable encryption or decryption errors during bus processing of custom and partner events. Errors during target delivery use the target DLQ.
- A Lambda target is invoked asynchronously. Once Lambda accepts the event, Lambda handles later function execution errors, retries them twice by default, and uses its own failure destination or DLQ if configured.
The DLQ must be a standard SQS queue in the rule’s Region. Its resource policyA permission document attached to a resource that controls access to it., a permission document attached to the queue, must allow events.amazonaws.com to call sqs:SendMessage. Restrict that permission with the rule’s Amazon Resource NameAn identifier for an AWS resource. (ARN), its AWS resource identifier. The console adds access for a same-account queue. API setup and cross-account queues require a manually attached policy.
Exam cues
- If the question says preserve events after a target outage exceeds retries, think a target DLQ, because delivery attempts eventually stop.
- If the question says an event went to the DLQ without waiting, think missing permissions or a missing target, because those failures can bypass retries.
- If the question says the DLQ also loses deliveries, think its resource policy and
InvocationsFailedToBeSentToDLQ, because EventBridge must be able to write failures there.
Remember
- Defaults: up to 24 hours and 185 retries; duration and count are configurable.
- DLQ: standard SQS, same Region as the rule; FIFO is unsupported.
- Attributes include
RULE_ARN,TARGET_ARN,ERROR_CODE,ERROR_MESSAGE,EXHAUSTED_RETRY_CONDITION, andRETRY_ATTEMPTS. - Monitor
InvocationsSentToDLQandInvocationsFailedToBeSentToDLQ. - Bus-processing encryption failures and target-delivery failures use their respective configured DLQs.
- API destinationsAn HTTPS endpoint that EventBridge can invoke for a rule or pipe. retry HTTP 401, 407, 409, 429 and 5xx, but not other 4xx responses.
- An SQS target encrypted with a customer managed key needs the EventBridge service principal to have
kms:Decryptandkms:GenerateDataKeyin the key policy. AWS owned keyA KMS key owned and managed by an AWS service, outside your account. encryption is unsupported for SQS targets and target DLQs.
Trap: Configuring retries does not retain an event forever. After the retry policy is exhausted, an event without a DLQ is dropped.
EventBridge attempts target delivery and retries retriable failures according to its policy.
A configured DLQ receives the event after retry exhaustion; missing permissions or a missing target can bypass retries.
Da documentação da AWS (17)
- For retriable target-delivery errors, EventBridge retries for up to 24 hours and up to 185 retries by default.
- Target-delivery retries use exponential backoff with jitter, a randomized delay.
- A rule target retry policy configures retry duration and retry count.
- Events that exhaust delivery retries are dropped unless a target DLQ is configured.
- Missing target permissions or a missing target can send an event directly to its DLQ without retries.
- A rule target DLQ must be a standard SQS queue; FIFO queues are unsupported.
- A rule target DLQ must be in the same Region as the rule.
- The DLQ resource policy must allow events.amazonaws.com to perform sqs:SendMessage, and can restrict access by the rule ARN.
- The console attaches DLQ permissions for a same-account queue; API configuration and cross-account queues require a manually attached queue policy.
- DLQ messages include RULE_ARN, TARGET_ARN, ERROR_CODE, ERROR_MESSAGE, EXHAUSTED_RETRY_CONDITION, and RETRY_ATTEMPTS.
- InvocationsSentToDLQ and InvocationsFailedToBeSentToDLQ report successful and failed DLQ delivery in CloudWatch.
- For custom and partner events, a non-retriable encryption or decryption error during event-bus processing goes to the bus DLQ if configured; an error during target delivery goes to the target DLQ if configured.
- Lambda handles asynchronous function errors and retries them twice by default.
- EventBridge invokes Lambda rule targets asynchronously.
- An SQS target encrypted with a customer managed KMS key requires a key policy allowing EventBridge kms:Decrypt and kms:GenerateDataKey.
- EventBridge does not support SQS targets or target DLQs encrypted with an AWS owned key.
- EventBridge API destinations retry HTTP 401, 407, 409, 429 and 5xx responses, but not other 4xx responses.
Archive and replay
An EventBridge archive stores selected bus eventsA JSON message that describes an occurrence or change. so they can be sent through processing again. Replay resends those stored events to the bus that first received them, which helps recover from consumer errors or test changed processing.
How it works
- Create an archive on the source bus. An optional event patternA JSON filter describing the fields and values an event must match. selects what it captures. Set retentionThe duration for which events or records remain stored. in days or leave the default of indefinite retention.
- Allow events to enter the archive. AWS recommends waiting 10 minutes before replay so archive delivery can catch up.
- Start replay with a time range. Its destination is the original source bus, and you can limit replay to selected rules there.
- EventBridge processes the range in one-minute intervals based on event time. Original arrival order is not guaranteed.
- Each replayed event receives
replay-namemetadataInformation about an event such as its source or originating account., information identifying its replay. A managed ruleA rule maintained by an AWS service for a service feature., a rule maintained by EventBridge, prevents those events from entering the archive again. The archived originals remain available for another replay while retained.
Exam cues
- If the question says repair a consumer and reprocess captured events, think archive replay, because the stored events can pass through the source bus again.
- If the question says test only one changed rule, think replay with selected rules, because replay can limit which source-bus rules receive the events.
- If the question says replay into a different bus, think the original source-bus restriction, because an archive cannot choose a new destination bus.
Remember
- One archive has one fixed source bus.
- Retention defaults to indefinite; a configured duration is in days.
- Replay uses one-minute event-time intervals and does not guarantee original order.
replay-nameidentifies replayed events and prevents archive recapture.- Replay does not consume the archived originals.
Trap: Replay reads an archive. Creating an archive after a processing incident does not supply events that the archive never captured.
The archive captures selected incoming events from its fixed source bus.
A replay sends a chosen event time range back to that same bus.
Selected rules route replayed events to their targets; replay-name prevents archiving them again.
Da documentação da AWS (10)
- An EventBridge archive retains bus events for later replay to recover processing or test functionality.
- An archive can select events using an event pattern.
- Archive retention is specified in days and defaults to indefinite retention.
- An archive receives events from one source bus, and that association cannot be changed.
- A replay can send archived events only to the original source bus.
- A replay selects an event time range and can be limited to specific rules on the source bus.
- Replaying does not remove events from the archive, so the same events can be replayed again.
- Replay does not guarantee original order and processes events in one-minute intervals based on event time.
- Replayed events have replay-name metadata, and an EventBridge managed rule excludes them from archiving again.
- AWS recommends waiting 10 minutes before replay to allow archive delivery to catch up.
Pipes filtering and enrichment
EventBridge Pipes connects one source to one targetA resource or endpoint that receives a matching event. and prepares selected eventsA JSON message that describes an occurrence or change. between them. Filtering selects messages; enrichmentA processing step that adds or changes event data before target delivery. adds or changes their data before delivery. It is a point-to-point connectionA configuration holding authorization and connectivity settings for an API destination., meaning one input source and one output target.
How it works
- Choose a supported source: SQS, Kinesis, DynamoDB StreamsA sequence of records retained for consumers to read., Amazon MQ, Amazon MSK, or self-managed Apache Kafka. A stream is a retained sequence of records that a consumer reads.
- Add an optional event filter. Only matches proceed to enrichment and target invocation, and only matches incur pipe processing charges. For SQS, unmatched messages are removed from the queue.
- Add optional enrichment using Lambda, API Gateway, an API destinationAn HTTPS endpoint that EventBridge can invoke for a rule or pipe., or a Step Functions Express workflow. Enrichment runs synchronously, meaning Pipes waits for the response before continuing.
- Invoke the target with the prepared event. To observe a compute target’s runtime error, use a synchronous invocationAn invocation that waits for a response before continuing.. Pipes cannot retry errors inside an asynchronously invoked Step Functions Standard workflow.
- Configure recovery for the source. A partial batchA group of records processed together. response can identify individual failed records in an SQS, Kinesis, or DynamoDB batch, a group processed together.
- If the source uses a customer managed KMS keyA KMS key that you create and control, including its access policy., allow
kms:Decryptin both the key policy and the pipe execution roleAn IAM role that Scheduler assumes to invoke a target on a caller's behalf., the IAM role Pipes uses to access resources.
| Source | Customer invocation failure | Dead-letter destination |
|---|---|---|
| SQS | Queue maximum receive count limits retries | Source queue redrive policyQueue settings that move repeatedly failed messages to a dead-letter queue. and DLQA queue that retains events whose delivery failed so they can be processed later. |
| Kinesis | Pipe retry count or maximum record age | Optional SQS or SNS destination; FIFO unsupported |
| DynamoDB Streams | Pipe retry count or maximum record age | Optional SQS or SNS destination; FIFO unsupported |
A redrive policy defines when a queue moves repeatedly failed messages to its DLQ. For Kinesis and DynamoDB, set pipe maximum record age below source retentionThe duration for which events or records remain stored., the time records remain available, so the pipe can deliver failures before the source removes them.
Exam cues
- If the question says one queue needs filtering and enrichment before one target, think Pipes, because those steps are built into its connection.
- If the question says an SQS-source pipe repeatedly fails, think source queue redrive policy, because its receive-count and DLQ settings govern customer-error recovery.
- If the question says a stream record expires before dead-letter delivery, think a shorter pipe maximum record age, because the source must still retain the record when Pipes gives up.
- If the question says a Standard workflow fails after the pipe starts it, think workflow-level error handling, because the pipe’s asynchronous invocationAn invocation where the caller does not wait for the later processing result. does not expose that runtime failure.
Remember
- Order: source, filter, enrichment, target.
- Step Functions enrichment supports Express workflows only.
- SQS filtering removes unmatched messages.
- Kinesis and DynamoDB pipe DLQs can be SQS or SNS, with no FIFO DLQ support.
- Internal errors retry until source expiration and do not count against the stream retry limit or SQS maximum receive count.
Trap: Two filtered pipes on one SQS queue do not form independent subscriptions. They compete for messages, and an unmatched message is removed by the pipe that reads it.
Pipes reads source messages and evaluates its filter.
Matching messages reach the synchronous enrichment.
After enrichment responds, Pipes invokes the target with the prepared data.
Da documentação da AWS (15)
- A pipe connects one source to one target with optional filtering followed by optional enrichment.
- Pipe sources include SQS, Kinesis, DynamoDB Streams, Amazon MQ, Amazon MSK, and self-managed Apache Kafka.
- Only events matching the pipe filter are charged for pipe processing.
- Pipe enrichments can use Lambda, API Gateway, API destinations, or Step Functions Express workflows.
- Enrichment is synchronous: Pipes waits for its response before invoking the target.
- Pipes removes SQS messages that do not match the filter.
- For customer invocation errors with an SQS source, retry count follows the source queue maximum receive count.
- An SQS-source pipe uses the source queue redrive policy and DLQ.
- For customer invocation errors with Kinesis or DynamoDB sources, retries stop at the retry-count limit or maximum record age, whichever comes first.
- Kinesis and DynamoDB source pipes can use SQS or SNS dead-letter destinations, but not FIFO DLQs.
- A stream pipe maximum record age should be shorter than source retention so failed records can reach its DLQ before expiring.
- Pipes supports partial batch failure handling for target failures with SQS, Kinesis, and DynamoDB sources.
- A pipe must invoke compute synchronously to observe runtime errors; it cannot retry execution failures inside an asynchronously invoked Step Functions Standard workflow.
- Pipes retries internal errors until the record expires in the source; these retries do not count against stream retry limits or the SQS maximum receive count.
- For a pipe source encrypted with a customer managed KMS key, both the pipe execution role and the key policy need to allow kms:Decrypt.
Scheduler
EventBridge Scheduler invokes a targetA resource or endpoint that receives a matching event. at a chosen time or on a recurring schedule. It supports local time zones and flexible delivery windows, so a job can follow a calendar or run within an acceptable interval.
How it works
-
Choose the schedule expression, text describing when the job runs.
Expression Use Timing rateRegular intervals Without StartDate, begins immediatelycronCalendar-based recurrence Six fields: minutes, hours, day of month, month, day of week, year atOne-time invocation Runs at the specified date and time -
For cronA schedule expression that identifies recurring calendar times. or one-time execution, choose an IANA time zoneA named time zone whose rules define local clock offsets and daylight saving changes., a named set of local clock rules.
-
Set the flexible time window to
OFFor choose a window within which invocation can occur. -
Provide an execution roleAn IAM role that Scheduler assumes to invoke a target on a caller's behalf., an IAM role assumed by
scheduler.amazonaws.com, with permission to call the target. -
Configure retry age, retry count, and a standard SQS DLQA queue that retains events whose delivery failed so they can be processed later. for failed invocations. Grant the execution role permission to send messages to the DLQ.
Legacy scheduled rules use the default event busA router that receives events and sends matches to configured destinations., UTC, and at least one-minute precision. AWS recommends Scheduler for scheduled invocations. An existing rule can directly target the EBS CreateSnapshot API without a Lambda intermediary.
Exam cues
- If the question says run once in a named time zone, think Scheduler with
at, because one-time scheduling and time zones are supported. - If the question says keep the same local daily time, think cron with the local time zone, because a rate day is always 24 hours.
- If the question says distribute jobs within an acceptable interval, think a flexible time window, because Scheduler can spread invocations within it.
- If the question says retain failed scheduled invocations, think a standard SQS DLQ plus execution-role permissions, because Scheduler must deliver the failure there.
Remember
- Types:
rate,cron, andat. - Retry configuration: 60 to 86400 seconds of eventA JSON message that describes an occurrence or change. age and 0 to 185 retries; the first exhausted limit stops retries.
- A rate day is 24 hours, including daylight saving transitions.
- A schedule can pass an input payload to its target.
Trap: A rate day is always 24 hours, so it can shift relative to local wall-clock time when daylight saving time changes.
Da documentação da AWS (12)
- Scheduler supports recurring rate and cron schedules and one-time at schedules.
- Cron and one-time schedules can use an IANA time zone.
- A rate schedule without StartDate begins invoking its target immediately.
- Scheduler cron expressions have six fields: minutes, hours, day of month, month, day of week, and year.
- A day in a rate schedule is a 24-hour duration even across daylight saving changes.
- A flexible time window spreads target invocation within the configured window; choose OFF to disable it.
- Scheduler assumes an execution role trusting scheduler.amazonaws.com to call the target.
- Scheduler retry policy accepts an event age of 60 to 86400 seconds and 0 to 185 retries; retries stop when either limit is reached.
- Scheduler supports a standard SQS DLQ and its execution role needs sqs:SendMessage permission to deliver failed invocations there.
- Scheduled rules are a legacy feature limited to the default bus, use UTC, and have one-minute minimum precision; AWS recommends Scheduler for scheduled target invocation.
- An EventBridge rule can target the EBS CreateSnapshot API directly.
- An EventBridge Scheduler schedule names its target, an execution role and an optional input that it delivers to the target, such as a JSON payload for a Lambda function.
Cross-account routing
Cross-account EventBridge routing sends selected eventsA JSON message that describes an occurrence or change. to a bus owned by another AWS account. It lets a central account receive events while each sender keeps its own rules.
How it works
- Attach a resource policyA permission document attached to a resource that controls access to it., permissions stored on the receiving bus, allowing the sender account or AWS organization.
- In the sender, create a rule that targetsA resource or endpoint that receives a matching event. the receiving bus’s Amazon Resource NameAn identifier for an AWS resource. (ARN), its AWS identifier. Attach an IAM role with permission to send events there.
- In the receiver, create rules for the forwarded events. Include the originating
accountIDs to keep unrelated account events from triggering a matching local rule. - Deliver matches to the receiver’s local targets. Do not design an onward chain to another account or a third bus.
- Apply any required target input transformation on an eligible receiving target. A cross-account event-bus target cannot use
Input,InputPathorInputTransformer.
Since March 2023, new cross-account event-bus targets require an IAM role. AWS specifies the cutoff as March 2, 2023; older targets without roles are unaffected. Routing may also cross Regions when the destination Region supports reception.
Exam cues
- If the question says centralize events from many accounts, think receiving bus policy plus sender rules and roles, because both reception and sending need authorization.
- If the question says another account’s events trigger a local-only rule, think an
accountfilter, because a matching rule otherwise also accepts authorized incoming events. - If the question says forward A to B to C, think direct routes from the origin, because received events are not forwarded onward to a third account.
Remember
- Receiver: bus resource policy and matching rules.
- Sender: receiving bus ARN as target and an IAM role.
- New target role requirement: after March 2, 2023.
- A third-account hop and a three-bus forwarding chain are unsupported.
- Cross-account bus targets cannot use
Input,InputPathorInputTransformer.
Trap: Trusting the sender in the receiving bus policy does not configure the sender’s target role. Both sides need their part of the routing setup.
The sending rule targets the receiver bus ARN using an IAM role.
The receiving bus permits the sender and its rule selects the expected account events.
A receiving rule invokes its local target.
Da documentação da AWS (10)
- EventBridge can send events from a rule in one account to a receiving bus in another account.
- The receiving bus resource policy must allow the sender account or organization.
- The sender configures the receiving bus as a rule target using its ARN.
- Cross-account event-bus targets created after March 2, 2023 require an IAM role; older targets without one are unaffected.
- Rules on the receiving bus select forwarded events for its local targets.
- Adding account IDs in the account pattern field restricts which event origins can trigger a receiving rule.
- An event received from another account is not forwarded onward to a third account.
- An event forwarded between buses in one account is not forwarded onward to a third bus.
- Cross-account bus routing can also cross Regions when the destination Region supports cross-Region reception.
- Input, InputPath and InputTransformer cannot be specified on a rule target that is an event bus in a different account.
Operational events and timing
EventBridge patterns select operational eventsA JSON message that describes an occurrence or change. for a response, while EventBridge Scheduler controls when a targetA resource or endpoint that receives a matching event. is invoked. Pattern operators and schedule timing determine which events and invocations reach their targets.
How it works
- Build an event patternA JSON filter describing the fields and values an event must match.. Different fields combine with AND, values in one array combine with OR, and
$oroffers alternatives across fields. - Select operators for the values:
suffixmatches a string ending,cidrmatches an IPv4 or IPv6 network range, andequals-ignore-caseignores letter case. - Select operational events. Auto Scaling lifecycle hooks emit events when an instance enters a wait state. Instance refresh emits checkpoint and status events, including rollback changes.
- For an exposed credential, match the AWS Health event
AWS_RISK_CREDENTIALS_EXPOSEDand start a Step Functions remediation workflow. For X-Ray insight events, enable both insights and notifications on the group. - For Scheduler, choose a flexible time window to spread invocations, or set it to
OFF. Consider daylight saving transitions when a cronA schedule expression that identifies recurring calendar times. schedule uses local time.
Exam cues
- If the question says accept either of two states from one source, think two values in one array and a separate source field, because values combine with OR and fields with AND.
- If the question says match a filename ending, an IP network, or a string in any letter case, think
suffix,cidr, orequals-ignore-case, respectively. - If the question says respond to a lifecycle hook wait or track an instance refresh, think lifecycle action events or instance refresh events, because they report those respective conditions.
- If the question says remediate an exposed access key, think
AWS_RISK_CREDENTIALS_EXPOSEDand a Step Functions target. - If the question says X-Ray insights are missing from EventBridge, think both group settings, because insights and notifications must be enabled.
Remember
- Ordinary string matching is case sensitive.
- A nonexistent spring cron time is skipped. A repeated autumn time runs once, at its second occurrence after the shift.
- With no flexible time window, Scheduler invokes with 60-second precision.
Trap: A repeated autumn cron time does not run twice. Disabling the flexible window also does not guarantee an exact-second invocation.
Da documentação da AWS (13)
- Pattern fields combine with AND, values in one array combine with OR, and $or combines alternatives across fields.
- The suffix operator matches the end of a string.
- The cidr operator matches IP addresses within an IPv4 or IPv6 network range.
- The equals-ignore-case operator matches strings regardless of letter case.
- Ordinary string matching is case sensitive.
- Auto Scaling lifecycle hooks generate EventBridge events when instances enter a wait state.
- Auto Scaling instance refresh emits events for checkpoints, start, success, failure, cancellation, and rollback state changes.
- An AWS Health AWS_RISK_CREDENTIALS_EXPOSED event can trigger a rule that starts a Step Functions remediation workflow.
- Enable insights and notifications on an X-Ray group to send insight events through EventBridge.
- A cron invocation at a repeated local time during the autumn daylight saving transition runs only once, at the second occurrence after the shift.
- A cron invocation at a nonexistent local time during the spring daylight saving transition is skipped.
- Scheduler invokes targets with 60-second precision when no flexible time window is set.
- A flexible time window spreads target invocation within the configured window; choose OFF to disable it.
Flashcards
Nada para revisar aqui agora. Escolha outros tópicos ou outro filtro.
·
Todos os 52 flashcards em lista
How does an EventBridge event-bus rule select events and how many targets can it invoke?
It compares event fields with a JSON event pattern and sends matches to up to five targets.
An operations team wants an EventBridge workflow when an EC2 instance stops. What should the rule match?
Match source
aws.ec2, detail-typeEC2 Instance State-change Notification, anddetail.stateequal tostopped; select an authorized response target.An EventBridge rule must detect S3 object API calls through CloudTrail. What logging and event fields are needed?
Enable a trail with the relevant S3 data events. Match
AWS API Call via CloudTrail,detail.eventSource, anddetail.eventNameon the default bus.A team wants EventBridge to route selected GuardDuty or Security Hub CSPM findings to response automation. What should it configure?
Create a finding event pattern and choose an authorized Lambda, Step Functions, or Systems Manager Automation target. Security Hub CSPM finding attributes can narrow the rule.
A team wants an email notification when CodePipeline execution fails. How should EventBridge route the event?
Match
CodePipeline Pipeline Execution State Changewith stateFAILEDand target SNS.Which EventBridge buses receive AWS service, custom application, and SaaS partner events in the Classic rules model?
Default bus for AWS service events, custom Classic bus for application events, and partner bus for SaaS partner events.
An EventBridge target needs a short message containing selected fields from the original event. What avoids a formatting Lambda?
Use an input transformer with JSONPath variables and an input template.
A team wants an Amazon EventBridge rule to start a workflow when an S3 object is created. What should it configure?
Enable EventBridge notifications for the bucket, then create a matching rule with a Step Functions workflow as its target.
An EventBridge rule must call an HTTPS application with configured authorization. Which target fits and what response deadline matters?
Use an API destination with a connection. The endpoint must respond within five seconds or EventBridge times out and applies its retry policy.
An EventBridge rule must launch an ECS task or run a command on a new Auto Scaling managed node. Is a Lambda intermediary required?
No. ECS tasks and Systems Manager Run Command are direct rule targets. Configure target permissions and parameters.
A team needs EventBridge automation on Trusted Advisor status changes sooner than the built-in email summary. What should it configure?
Create rules for Trusted Advisor check status changes in US East (N. Virginia). Built-in summary emails are weekly; a low-utilization EC2 finding can supply a cost-review candidate.
How can every new object in an S3 bucket start a Step Functions workflow without a Lambda function in between?
Turn on EventBridge notifications for the bucket and add an EventBridge rule on Object Created that targets the state machine.
An EventBridge rule targets a Kinesis data stream. Do you grant access with a resource-based policy on the stream?
No. Kinesis targets use an IAM role that EventBridge assumes; resource-based policies are the path for targets such as Lambda, SNS, SQS and CloudWatch Logs.
What does an EventBridge rule do when target delivery keeps failing with retriable errors?
By default, retry for up to 24 hours and up to 185 retries with exponential backoff and jitter. When retries are exhausted, send to the configured target DLQ or drop the event.
What queue and permissions does an EventBridge rule target DLQ require?
A standard SQS queue in the rule Region. Its resource policy must allow
events.amazonaws.comto callsqs:SendMessage; restrict it to the rule ARN. API and cross-account setup require adding the policy manually.An EventBridge rule loses events after a long target outage. How can the team retain failed deliveries for later processing?
Configure a target DLQ and its queue policy. Retries eventually stop; the DLQ retains failed deliveries for investigation and later processing.
An EventBridge target loses invocation permission and its event immediately appears in the DLQ. Why were there no retries?
Missing-permission errors can go directly to the DLQ. Fix target access before processing the event again.
An EventBridge rule has a DLQ but failed events do not arrive there. Which signal and permission should operators inspect?
Check
InvocationsFailedToBeSentToDLQand the queue resource policy allowingevents.amazonaws.comto usesqs:SendMessage.An EventBridge bus encrypted with a customer managed KMS key encounters a non-retriable decryption error while processing a custom event. Which DLQ receives it?
The event-bus DLQ, if configured. Errors during target delivery use the target DLQ instead.
An EventBridge rule successfully invokes a Lambda target, but the Lambda function later fails. Which service handles the function error retries?
Lambda handles its asynchronous function execution retries. Configure Lambda failure handling separately from the EventBridge target DLQ.
An EventBridge rule cannot deliver to an SQS target encrypted with a customer managed KMS key despite queue access. What key policy permissions should the team check?
Allow EventBridge kms:Decrypt and kms:GenerateDataKey in the KMS key policy.
An EventBridge API destination returns HTTP 429 for one event and HTTP 400 for another. Which response is retried?
HTTP 429 is retried; HTTP 400 is not among the retried 4xx responses.
Can an EventBridge rule use an SQS queue encrypted with an AWS owned key as its target DLQ?
No. EventBridge does not support AWS owned key encryption for SQS targets or target DLQs.
A team fixed an EventBridge consumer and needs to reprocess last week's captured events. What should it use?
Replay the existing archive for that time range to its source bus, optionally limiting delivery to selected rules. An archive can filter captured events and defaults to indefinite retention.
What ordering and metadata should an EventBridge archive replay consumer expect?
Original order is not guaranteed. Replay processes one-minute intervals of event time and adds
replay-name. Replayed events are excluded from archiving again.A team wants to test one updated EventBridge consumer without replaying archived events to every rule. What can it configure?
Select the relevant rules when starting replay. The destination must still be the archive's source bus.
An EventBridge archive was replayed once. Must a team create a new archive before replaying the same retained events again?
No. Replay leaves events in the archive, so they can be replayed again while retained.
A team needs EventBridge to filter and enrich messages from one supported source before one target. Which feature fits?
Use EventBridge Pipes: source, optional filter, optional synchronous enrichment, then target. Enrichment can use Lambda, API Gateway, API destinations, or Step Functions Express.
How do EventBridge Pipes customer-error retries and dead-letter handling differ for SQS and stream sources?
SQS uses the source queue maximum receive count and redrive DLQ. Kinesis and DynamoDB use pipe retry count or record age, then an optional SQS or SNS DLQ; FIFO DLQs are unsupported for those streams.
A team wants only selected messages to reach EventBridge Pipes enrichment and the target. What should it add?
Add a filter before enrichment. Only matching events proceed, and only matching events incur pipe processing charges.
An EventBridge Pipe reads an SQS queue and rejects a message with its filter. Can another consumer later receive that rejected message?
No. Pipes removes unmatched SQS messages from the source queue.
An EventBridge Pipe starts a Step Functions Standard workflow, which later fails. Why does the pipe not retry that workflow failure?
Standard workflow targets are invoked asynchronously. Pipes cannot observe and retry errors inside the later workflow execution.
How can EventBridge Pipes avoid retrying an entire SQS, Kinesis, or DynamoDB batch after some target records fail?
Use partial batch failure handling so the target identifies failed records.
An EventBridge Pipe encounters internal errors while reading a Kinesis stream. Do those retries count against the pipe's maximum retry attempts?
No. Internal retries do not count against that limit and continue until the source record expires.
An EventBridge Pipe cannot read an SQS source encrypted with a customer managed KMS key. What encryption permissions should be checked?
Allow kms:Decrypt for the pipe execution role in both the role permissions and the key policy.
Which EventBridge feature supports one-time schedules, local time zones, and flexible delivery windows?
EventBridge Scheduler. Use
atfor one-time execution,cronfor calendar schedules, andratefor regular intervals.A team needs a daily EventBridge job at a local wall-clock time across daylight saving changes. Which schedule should it choose?
Use Scheduler with a cron expression and the required IANA time zone. A rate day is always 24 hours and can shift relative to local wall-clock time.
A team needs EventBridge Scheduler failures retained after retries. Which configuration and permissions are needed?
Configure a standard SQS DLQ and give the Scheduler execution role
sqs:SendMessagepermission. The role must also authorize the target invocation.An existing scheduled EventBridge rule must create EBS snapshots without a Lambda function. Which target is available?
Use the built-in EBS
CreateSnapshottarget. Scheduled rules use the default bus and UTC; AWS recommends Scheduler for new scheduled invocations.A Lambda function invoked by Amazon EventBridge Scheduler needs a customer ID on each run. How can the schedule pass it?
Set the schedule target's input; Scheduler delivers that payload to the function.
What permissions and routing are needed for an EventBridge rule to send events to a bus in another account?
Allow the sender in the receiving bus resource policy, target that bus ARN from the sending rule, and supply the sending target role. Add receiving rules with an
accountfilter for expected origins.EventBridge forwards an event from account A to a bus in B, whose rule targets a bus in C. Does C receive that forwarded event?
No. EventBridge does not forward that received event onward to a third account. Configure direct routing from the originating account to each required destination.
A shared EventBridge receiver unexpectedly triggers a local rule for another account's events. What should the rule add?
Add the intended originating account IDs in the
accountfield of its event pattern.An EventBridge team plans to route an event through three buses in one account. Will forwarding through the middle bus reach the third?
No. EventBridge does not forward an already forwarded event onward through that bus chain.
A team sends an EventBridge rule's event to a bus in another account and wants to transform the payload on that sending target. Can it configure an InputTransformer there?
No. InputTransformer, InputPath and Input are unavailable on a cross-account event-bus target. Transform at an eligible receiving target instead.
An EventBridge pattern must accept either of two states and also require one source. How do its conditions combine?
Put both states in one array for OR and specify the source in a separate field for AND. Use
$orfor alternatives across fields.Which EventBridge operators match a filename ending, a network range, and a string regardless of case?
Use
suffix,cidr, andequals-ignore-case, respectively. Ordinary string matching is case sensitive.A team needs an EventBridge response when an Auto Scaling instance is held for launch preparation, and progress alerts during an instance refresh. Which events should it select?
Select lifecycle action events for the hook wait state and instance refresh events for checkpoints and refresh status changes.
A team wants EventBridge to start remediation for an exposed IAM access key reported by AWS Health. Which event identifies the condition?
Match the AWS Health event type code
AWS_RISK_CREDENTIALS_EXPOSEDand target a Step Functions remediation workflow.A team enabled an X-Ray group but receives no EventBridge notifications for detected fault-rate insights. Which settings are required?
Enable both insights and notifications on the group.
An EventBridge Scheduler cron time occurs twice when clocks move backward. How many scheduled invocations occur for that local time?
One. A repeated autumn time runs only once; a nonexistent spring time is skipped.
Does disabling the EventBridge Scheduler flexible time window guarantee invocation at an exact second?
No. Scheduler still invokes with 60-second precision.