An AWS Lambda function is configured to run inside private subnets of a VPC in order to securely read data from an Amazon RDS DB instance. The function must also fetch data from a public weather API endpoint on the internet. Although database queries succeed, all HTTP requests to the public weather API fail with a timeout. Which of the following networking configurations will resolve this issue?
- AAssociate a public IP address directly to the Elastic Network Interfaces (ENIs) assigned to the Lambda function.
- BIncrease the execution timeout configuration of the Lambda function to the maximum value of 15 minutes.
- Deploy a NAT Gateway in a public subnet of the VPC and route outbound internet traffic from the private subnets through the NAT Gateway.Cevap
- DAssign an IAM policy to the Lambda function execution role that allows the ec2:AssociateAddress action.
Cevap
Deploy a NAT Gateway in a public subnet of the VPC and route outbound internet traffic from the private subnets through the NAT Gateway.
The correct option correctly states that deploying a NAT Gateway in a public subnet and routing outbound internet traffic from the private subnets through it is the standard and recommended way to grant internet access to AWS Lambda functions running in a private VPC subnet.
Adım Adım Çözüm
Anahtar Kavram
AWS Lambda VPC networking and outbound internet connectivity requirements.
Tahmini Süre:1m 0s