An application uses an AWS Lambda function associated with private subnets of a VPC to perform write operations on an Amazon RDS PostgreSQL database. The function also needs to write tracking data to an Amazon DynamoDB table, but the write operations to DynamoDB are failing with connection timeout errors. Which two actions should a developer take to resolve this connectivity issue? (Select TWO.)
- Create a Gateway VPC Endpoint for Amazon DynamoDB and associate it with the route table used by the Lambda function's subnets.Answer
- Deploy a NAT Gateway in a public subnet of the VPC, and add a route pointing to it in the private subnet's route table.Answer
- CConfigure the Lambda function to use the public subnets of the VPC and enable the public IP assignment setting on the function configuration.
- DAttach an Internet Gateway directly to the private subnets' route table with a destination route of .
- EUpdate the Lambda function's IAM execution role to include the DynamoDB policy with the AmazonDynamoDBFullAccess permission.
Answer
To resolve the connection timeout issue, the developer must either create a Gateway VPC Endpoint for Amazon DynamoDB and associate it with the private subnet's route table, or deploy a NAT Gateway in a public subnet and route the private subnet's internet-bound traffic through it.
The Lambda function is failing to reach the public DynamoDB endpoint because it is running inside private subnets of a VPC without access to public endpoints. The two correct options resolve this: one by establishing a Gateway VPC Endpoint that routes DynamoDB traffic internally, and the other by establishing a NAT Gateway in a public subnet to allow outbound internet access for resources in private subnets.
Step-by-Step Solution
Key Concept
VPC Networking for AWS Lambda Functions
Estimated Time:1m 30s