A developer is designing an integration where transactional events from an order management system are published to an Amazon EventBridge custom event bus. The developer must route only 'OrderCompleted' events with a 'total_value' greater than $500 to an Amazon Kinesis Data Stream for real-time analysis. The Kinesis stream has multiple shards, and events belonging to the same customer must be processed in order by the same shard.
Which TWO configurations should the developer implement to meet these requirements?
- Define an EventBridge event pattern that filters for the 'OrderCompleted' detail-type and uses a numeric comparison to check that the 'total_value' is greater than 500.Cevap
- Configure the EventBridge rule's Kinesis Data Stream target to use a Partition Key Path that references the customer ID field in the event payload.Cevap
- CConfigure the EventBridge target for the Kinesis Data Stream to use a static partition key for all routed events to ensure they are grouped together.
- DConfigure the IAM role assumed by EventBridge to allow writing to the stream by defining the 'kinesis:PutRecord' action inside the role's trust policy.
- EConfigure the EventBridge rule to invoke a custom filtering Lambda function deployed in a private VPC subnet that lacks a NAT Gateway or Kinesis VPC endpoint.
Cevap
Define an EventBridge event pattern that filters for 'OrderCompleted' and a 'total_value' greater than 500, and configure the EventBridge rule's target to use a Partition Key Path referencing the customer ID field.
To meet the requirements, the developer must filter events and ensure ordering. Filtering is achieved by configuring an EventBridge event pattern matching the 'OrderCompleted' detail-type and checking that the total value is greater than 500 using a numeric comparison. Ordering per customer is achieved by routing events to the Kinesis stream with a partition key derived from the customer ID. Setting the Partition Key Path on the EventBridge Kinesis target ensures EventBridge extracts the customer ID dynamically from each event payload, routing all events for a given customer to the same shard in sequence.
Adım Adım Çözüm
Anahtar Kavram
Routing events from Amazon EventBridge to Amazon Kinesis Data Streams requires configuring event patterns for filtering and specifying a partition key path to distribute data across shards while preserving order.