A logistics company tracks fleet vehicle coordinates using IoT devices. The devices stream geolocation data to an Amazon Kinesis Data Stream. An AWS Lambda function is configured as a consumer to process batches of records and write them to a database inside a private VPC subnet. During peak hours, the developer notices two issues:
1. Some shards in the Kinesis Data Stream are experiencing ProvisionedThroughputExceededException errors, while others are underutilized.
2. The Lambda function runs but is unable to connect to external endpoints to fetch auxiliary driver details, resulting in connection timeouts.
Which two actions should the developer take to resolve these issues? (Select TWO.)
- Modify the producer application to use a high-entropy partition key, such as a combination of vehicle ID and timestamp, instead of a static region ID.Cevap
- BModify the producer application to use the vehicle's manufacturing year as the partition key to group data logically.
- Configure a NAT Gateway in a public subnet of the VPC, and update the route table of the private subnet to route all outbound traffic () to the NAT Gateway.Cevap
- DIncrease the Lambda function's timeout configuration to allow the connection attempts to retry and succeed without modifying subnet routing.
- EModify the Lambda function's IAM execution role trust policy to allow the Kinesis service to write records directly to the VPC database.
Cevap
Modify the producer application to use a high-entropy partition key (vehicle ID combined with a timestamp) and configure a NAT Gateway in a public subnet of the VPC to route outbound traffic from the private subnet.
Using a high-entropy partition key (vehicle ID combined with a timestamp) ensures data is evenly distributed across Kinesis shards, avoiding hot shards. Configuring a NAT Gateway in a public subnet and updating the private subnet route tables provides the Lambda function inside the private subnet with a valid path to route outbound traffic to the internet.
Adım Adım Çözüm
Anahtar Kavram
Amazon Kinesis Data Stream partitioning and AWS Lambda VPC network routing.