Question

Difficulty: MediumStream Processing and Event Routing with Amazon Kinesis and EventBridge

A developer is designing an event-driven integration where transaction events from an external order processing service are sent to a custom Amazon EventBridge event bus. The developer creates an EventBridge rule to route these events to an Amazon Kinesis Data Stream for real-time analytics. Each event is a JSON payload that includes `transaction_id`, `store_id`, and `amount`. To support analytics requirements, events must be distributed evenly across the stream's shards, and events with the same `transaction_id` must be processed in the exact order they were received.

Which target configuration should the developer specify in the EventBridge rule to meet these requirements?

  1. Set the target to the Kinesis Data Stream and configure the Partition Key Path to `$.detail.transaction_id`.Answer
  2. B
    Set the target to the Kinesis Data Stream and configure the Partition Key Path to a static string value such as `"transaction_payload"`.
  3. C
    Set the target to the Kinesis Data Stream and configure the trust policy of the EventBridge IAM role to allow the `kinesis.amazonaws.com` service principal to perform `sts:AssumeRole`.
  4. D
    Set the target to a downstream AWS Lambda function with its execution timeout set to 3 seconds to process the events directly from the EventBridge rule.

Answer

Set the target to the Kinesis Data Stream and configure the Partition Key Path to `$.detail.transaction_id`.
The correct configuration is to set the EventBridge rule target to the Kinesis Data Stream and configure the Partition Key Path to use the transaction identifier field. This dynamically extracts the high-entropy transaction ID from the payload, ensuring even shard utilization while maintaining ordered delivery for any single transaction.

Step-by-Step Solution

1
Analyze the requirements for ordered processing and even distribution across Kinesis shards.
Identify that events with the same transaction identifier must go to the same shard to maintain order, and the partition key must have high entropy to distribute the load.
Kinesis routes records to shards based on the hash of their partition keys; identical keys map to the same shard, while diverse keys distribute data evenly.
2
Configure the target settings for the Amazon EventBridge rule that forwards events to Kinesis.
Use the Partition Key Path setting to extract `$.detail.transaction_id` dynamically from the incoming event payload.
This allows EventBridge to dynamically assign the transaction ID as the partition key for each record sent to Kinesis.

Key Concept

Partitioning in Amazon Kinesis Data Streams via Amazon EventBridge target settings using high-entropy JSON paths.
Rate this question