Soru

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

A developer is designing a real-time multiplayer analytics pipeline. A game server fleet publishes telemetry events to a custom Amazon EventBridge event bus. The developer wants to route these events to an Amazon Kinesis Data Stream for session-based aggregation. To prevent write throttling due to uneven distribution of records and ensure EventBridge can successfully publish to the stream, which two configurations must the developer implement?

  1. Configure the EventBridge target for the Kinesis Data Stream to use a PartitionKeyPath that extracts the game session identifier (e.g., $.detail.game_session_id) from the JSON event payload.Cevap
  2. Associate an IAM role with the EventBridge rule target that has a trust policy allowing the events.amazonaws.com service principal to assume the role, and a permissions policy allowing the kinesis:PutRecord action.Cevap
  3. C
    Configure the EventBridge target to use a static string prefix as the partition key to guarantee that all telemetry events are ordered sequentially within a single shard.
  4. D
    Associate an IAM role with the EventBridge rule target that has a trust policy allowing the kinesis.amazonaws.com service principal to assume the role, and a permissions policy allowing the events:PutEvents action.
  5. E
    Configure a consumer Lambda function to process the Kinesis Data Stream from a private subnet without configuring a NAT Gateway or VPC endpoint.

Cevap

The developer must configure the EventBridge target to use a PartitionKeyPath that extracts the game session identifier from the JSON payload, and associate an IAM role with the target that trusts the EventBridge service principal and has permissions to put records into the Kinesis stream.
To successfully route events from EventBridge to Kinesis, EventBridge needs permission to write to the Kinesis stream. This is accomplished by creating an IAM role that trusts the EventBridge service principal (events.amazonaws.com) and contains permissions to perform the kinesis:PutRecord action on the target stream. Additionally, to avoid hot shards and write throttling (such as a ProvisionedThroughputExceededException), the partition key must have high cardinality. Using a PartitionKeyPath to extract a dynamic field like the session identifier from the event payload ensures records are evenly distributed across the stream's shards.

Adım Adım Çözüm

1
Analyze EventBridge target security requirements for Kinesis Data Streams.
Determine that EventBridge requires an IAM role with a trust policy for events.amazonaws.com and write access (kinesis:PutRecord) to the target stream.
EventBridge is a regional service that must assume a developer-provided role to publish events directly to a Kinesis stream target.
2
Analyze Kinesis partitioning strategy to prevent write throttling.
Determine that a dynamic PartitionKeyPath (like $.detail.game_session_id) must be specified in the EventBridge target configuration.
Using high-entropy fields distributes records evenly across multiple shards, preventing ProvisionedThroughputExceededException.
3
Evaluate network connectivity requirements for downstream consumers.
Ensure the consumer Lambda function has access to Kinesis, which requires internet access via a NAT Gateway or an AWS PrivateLink VPC endpoint if deployed in a private subnet.
Lambda functions inside a VPC require proper route tables and gateways to reach public AWS services.

Anahtar Kavram

Stream Processing and Event Routing with Amazon Kinesis and EventBridge
Tahmini Süre:2m 0s
Bu soruyu puanla