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?
- 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.Answer
- 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.Answer
- CConfigure 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.
- DCreate 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.
- EDeploy 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.
Answer
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.
Step-by-Step Solution
Key Concept
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.
Estimated Time:2m 0s