Soru

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

An agricultural technology company deploys IoT weather stations that report atmospheric measurements. The data is processed through an Amazon EventBridge custom event bus and must be ingested into an Amazon Kinesis Data Stream for real-time wind speed anomaly analysis. The developer must configure the system to ensure EventBridge can route events directly to Kinesis while preventing write throttling at the Kinesis shard level. Which TWO configuration steps should the developer perform to route these events successfully and maintain optimal ingestion performance?

  1. Create an IAM role with a trust policy that allows the events.amazonaws.com service principal to assume the role, and attach a permissions policy that grants kinesis:PutRecords access to the target Kinesis Data Stream.Cevap
  2. Configure the EventBridge target for the Kinesis Data Stream with a custom PartitionKeyPath pointing to a high-entropy field in the event payload, such as $.detail.station_id.Cevap
  3. C
    Configure the EventBridge target to use a static, constant string value (e.g., weather_data) as the partition key for the Kinesis Data Stream to keep all atmospheric measurements grouped together.
  4. D
    Create an IAM role with a trust policy that allows the kinesis.amazonaws.com service principal to assume the role, and attach a permissions policy that grants events:PutEvents access to the custom EventBridge event bus.
  5. E
    Deploy an intermediary AWS Lambda function in a private VPC subnet without a NAT Gateway or VPC endpoint to retrieve the EventBridge events and write them to the Kinesis Data Stream using the AWS SDK.

Cevap

To route events successfully and maintain performance, the developer must create an IAM role that allows the EventBridge service to assume it and write to Kinesis, and configure the Kinesis target in EventBridge with a high-entropy PartitionKeyPath using a field like the station ID.
The correct configurations involve setting up proper IAM trust and permissions, and choosing an appropriate partition key strategy. First, EventBridge must be authorized to write to Kinesis. This requires creating an IAM role that EventBridge (events.amazonaws.com) can assume via its trust policy, with permission to perform the kinesis:PutRecords action on the target stream. Second, to prevent write throttling and ensure even distribution of records across Kinesis shards, the developer should configure the EventBridge target with a custom PartitionKeyPath referencing a high-entropy attribute (like the weather station identifier $.detail.station_id) from the incoming event payload.

Adım Adım Çözüm

1
Evaluate the routing path and required IAM permissions.
Identify that EventBridge needs to call the Kinesis PutRecords API, which requires an IAM role with a trust policy allowing events.amazonaws.com and a permissions policy allowing kinesis:PutRecords.
Without the correct trust and permissions policy, EventBridge cannot assume the role to deliver events to Kinesis.
2
Evaluate the sharding and write throughput characteristics of Kinesis Data Streams.
Determine that a high-entropy partition key, such as $.detail.station_id, is necessary to evenly distribute records across all available shards.
A low-entropy or static partition key routes all data to a single shard, causing a hot shard and resulting in throughput limitations and throttling errors.
3
Assess alternate designs, such as using an intermediary Lambda function in a private VPC subnet.
Recognize that a Lambda function inside a private subnet without internet routing (NAT Gateway or VPC Endpoint) cannot connect to public Kinesis endpoints.
Lambda requires a path to the internet or an interface VPC endpoint to reach public AWS service APIs.

Anahtar Kavram

Direct event routing from Amazon EventBridge to Amazon Kinesis Data Streams requires both correct IAM authorization for the publisher and high-entropy partition keys to avoid partition throttling.
Tahmini Süre:2m 0s
Bu soruyu puanla