Soru

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

An application deployed on AWS Fargate publishes high-throughput security audit logs to an Amazon Kinesis Data Stream. An AWS Lambda function is configured to process the stream records in real-time. The Lambda function is deployed within private subnets of a VPC in order to access an internal Amazon RDS database. However, the Lambda function must also make outbound HTTPS calls to an external third-party security API to validate metadata.

During a high-traffic event, the developer notices two issues:
1. The Lambda function fails to connect to the external API, resulting in connection timeouts.
2. The Kinesis producer on Fargate receives ProvisionedThroughputExceededException errors on specific shards, even though the total stream ingestion rate is well below the overall provisioned limit.

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

  1. Configure a NAT Gateway in a public subnet of the VPC and update the private subnet's route table to route outbound internet traffic through the NAT Gateway.Cevap
  2. Update the Fargate producer application to use a high-cardinality identifier, such as a combination of UserID and a high-resolution timestamp, as the Kinesis partition key.Cevap
  3. C
    Increase the Lambda function's execution timeout configuration to 25 minutes to allow more time for the connection pool to clear and API calls to complete.
  4. D
    Modify the Fargate producer application to write all logs using a constant static partition key value to ensure that partition assignment is uniform.
  5. E
    Associate the Lambda function with a public subnet and enable the auto-assign public IP setting in the Lambda configuration to allow direct outbound internet routing.

Cevap

Configure a NAT Gateway in a public subnet of the VPC to route outbound internet traffic from the private subnets, and update the Fargate producer application to use a high-cardinality Kinesis partition key combining UserID and a timestamp.
To resolve the Lambda connectivity issue, the function needs a path to the internet. Because it resides in a private VPC subnet to access RDS, it must route outbound traffic through a NAT Gateway located in a public subnet. To resolve the Kinesis throttling issue, the producer must use a high-cardinality partition key (like a UserID and timestamp combination) to distribute records evenly across all available shards, avoiding hot shards.

Adım Adım Çözüm

1
Analyze the network path for the Lambda function in the private subnet.
Identify that the Lambda function lacks internet access because private subnets cannot route directly to the Internet Gateway without a NAT Gateway.
Since the external API resides on the public internet, a NAT Gateway is required to translate private IP addresses to a public IP.
2
Identify the cause of Kinesis ProvisionedThroughputExceededException under low aggregate load.
Determine that specific shards are hot due to an uneven distribution of records.
Hot shards occur when the partition key has low entropy, mapping too many writes to the same shard.
3
Select the correct partitioning strategy to spread the load.
Implement a high-entropy partition key (UserID + timestamp) so that hash values are distributed evenly across the key space.
This utilizes all provisioned shards in the Kinesis stream, resolving individual shard write throttling.

Anahtar Kavram

VPC internet connectivity for Lambda functions and high-entropy partition key design for Kinesis Data Streams.
Tahmini Süre:2m 30s
Bu soruyu puanla