A developer is optimizing and troubleshooting an AWS Lambda function that reads transaction configurations from an Amazon DynamoDB table and then posts authorization requests to a third-party payment gateway via HTTPS.
The Lambda function is configured to run inside a VPC within two private subnets. The VPC has a Gateway VPC Endpoint configured for DynamoDB. During testing, the Lambda function successfully queries DynamoDB but fails with a network timeout error when attempting to connect to the payment gateway's external API. Additionally, Amazon CloudWatch logs show high execution latency during warm starts because the DynamoDB client is re-instantiated on every invocation.
Which two actions must the developer take to resolve the network timeout and optimize execution performance? (Select two.)
- Configure a route in the route tables of the private subnets to direct internet-bound traffic () to a NAT Gateway deployed in a public subnet.Answer
- Initialize the DynamoDB SDK client outside of the Lambda handler function to reuse the client instance across subsequent invocations.Answer
- CEnable the public IP mapping setting on the Elastic Network Interfaces (ENIs) assigned to the Lambda function in the private subnets.
- DMove the Lambda function to a public subnet within the VPC and configure its security group to allow inbound HTTPS traffic from the payment gateway.
- EModify the Lambda function's IAM trust policy to allow the VPC Gateway Endpoint for DynamoDB to assume the execution role.