Soru

Zorluk: OrtaStream Processing and Event Routing with Amazon Kinesis and EventBridge

A logistics company operates a fleet of delivery trucks. Each truck publishes GPS telemetry events as JSON payloads to a custom Amazon EventBridge event bus. A developer is configuring an EventBridge rule to route these events directly to an Amazon Kinesis Data Stream for real-time tracking. A downstream AWS Lambda function is configured as the consumer of the Kinesis Data Stream. The developer wants to ensure that telemetry events from the same truck are routed to the same Kinesis shard to maintain order, and that the EventBridge rule has the necessary permissions to publish to the stream. Which two configurations must the developer perform to meet these requirements?

  1. Configure the Kinesis Data Stream target in the EventBridge rule with a PartitionKeyPath pointing to the truck ID field in the event payload, such as $.detail.truck_id.Cevap
  2. Create an IAM role for the EventBridge target that contains a trust policy allowing the events.amazonaws.com service principal to assume the role.Cevap
  3. C
    Configure the Kinesis Data Stream target in the EventBridge rule with a static partition key string such as 'truck-event-key' to ensure all payload records are written.
  4. D
    Create an IAM role for the EventBridge target that contains a trust policy allowing the kinesis.amazonaws.com service principal to assume the role.
  5. E
    Deploy the Lambda consumer function inside a private VPC subnet without a NAT Gateway or Kinesis VPC endpoint to secure the Kinesis stream polling traffic.

Cevap

Configure the Kinesis Data Stream target in the EventBridge rule with a PartitionKeyPath pointing to the truck ID (e.g., $.detail.truck_id), and create an IAM role for the EventBridge target with a trust policy that allows the events.amazonaws.com service principal to assume the role.
To route EventBridge events to Kinesis Data Streams while preserving chronological order for each truck, a partition key must be dynamically extracted from each event. The PartitionKeyPath property (e.g., $.detail.truck_id) allows EventBridge to read the truck ID from the event payload and assign it as the partition key. Furthermore, EventBridge requires an IAM role with permission to perform kinesis:PutRecord on the stream, and the role's trust policy must allow the events.amazonaws.com service principal to assume it.

Adım Adım Çözüm

1
Specify the partition key path for the Kinesis target.
The EventBridge target uses the PartitionKeyPath parameter (e.g., $.detail.truck_id) to extract the partition key from the JSON event payload.
This guarantees that events belonging to the same truck use the same partition key, routing them to the same Kinesis shard and maintaining their chronological order.
2
Configure the IAM execution role's trust relationships.
The trust policy of the IAM role includes events.amazonaws.com under the Principal block.
This allows the Amazon EventBridge service to assume the IAM role and invoke the target (Kinesis Data Stream) on behalf of the developer.

Anahtar Kavram

Routing events from Amazon EventBridge to Amazon Kinesis Data Streams with dynamic partition keys (PartitionKeyPath) and configuring correct service trust relationships.
Tahmini Süre:1m 30s
Bu soruyu puanla