Question

Difficulty: MediumStream Processing and Event Routing with Amazon Kinesis and EventBridge

A developer is building an IoT application that processes telemetry from a fleet of connected vehicles. The data is sent to an Amazon Kinesis Data Stream and processed by an AWS Lambda function. The JSON payload of each event includes `vehicle_id` (a unique UUID), `manufacturer` (e.g., 'CompanyA'), `timestamp`, and `speed`. The Lambda function must also route critical warning events to an Amazon EventBridge custom event bus.

During testing, the developer observes `ProvisionedThroughputExceededException` errors during peak periods, indicating uneven distribution of traffic across shards. Additionally, some Lambda executions fail because the function times out before completing the processing of a large batch of records, and the function is unable to route events to EventBridge when deployed inside a private VPC subnet.

Which two actions should the developer take to resolve these issues? (Select TWO.)

  1. Use the vehicle_id as the partition key for records published to the Kinesis Data Stream.Answer
  2. Decrease the BatchSize parameter in the Lambda event source mapping, and ensure the Lambda function timeout is configured to an appropriate value up to 15 minutes.Answer
  3. C
    Use the manufacturer as the partition key for records published to the Kinesis Data Stream.
  4. D
    Increase the Lambda function timeout to 25 minutes to allow sufficient time for large batches of records to complete processing.
  5. E
    Deploy the Lambda function in a private VPC subnet without configuring a NAT Gateway or VPC interface endpoints.

Answer

Use the vehicle_id as the partition key for the stream records, and decrease the BatchSize parameter on the Lambda event source mapping while ensuring the Lambda timeout is set to a value up to 15 minutes.
The correct options ensure the Kinesis stream shards are balanced using a high-entropy key (vehicle_id) and that the Lambda consumer is properly calibrated for batch size and timeout within the platform limit of 15 minutes.

Step-by-Step Solution

1
Select a high-entropy partition key.
Using the unique vehicle UUID (vehicle_id) distributes write operations evenly across Kinesis shards.
This prevents hot shards and resolves the ProvisionedThroughputExceededException.
2
Adjust the Lambda batch size and timeout settings.
Reduce BatchSize on the Kinesis event source mapping and adjust the Lambda function timeout up to the 15-minute maximum limit.
This ensures the function does not time out while processing large batches of stream records.
3
Ensure outbound connectivity in the private VPC subnet.
Provide internet access via a NAT Gateway or configure a VPC interface endpoint for Amazon EventBridge.
This allows the Lambda function to successfully communicate with the EventBridge API.

Key Concept

Kinesis Data Stream partitioning strategy and AWS Lambda execution limits and VPC routing.
Rate this question