A serverless microservice uses an AWS Lambda function to retrieve user configuration profiles from an Amazon ElastiCache cluster located in a private VPC subnet, and then sends SMS notifications by calling a third-party gateway's HTTP API over the internet. The Lambda function is configured to run in the same VPC and private subnets as the ElastiCache cluster. During execution, the Lambda function successfully connects to ElastiCache, but the HTTP requests to the third-party gateway consistently fail with connection timeout errors. Which two configuration actions should the developer take to resolve this network connectivity issue? (Select TWO.)
- AMove the Lambda function to a public subnet of the VPC to grant it direct internet access through the VPC's Internet Gateway.
- Deploy a NAT Gateway in a public subnet of the VPC, and configure the route table of the Lambda function's private subnets to route traffic destined for through the NAT Gateway.Cevap
- CEnable the public IP assignment configuration option on the Lambda function to allow direct routing through the Internet Gateway.
- Verify that the security group associated with the Lambda function has outbound rules allowing egress HTTP/HTTPS traffic to the internet.Cevap
- EAttach the AWS-managed policy AWSLambdaVPCAccessExecutionRole to the Lambda function's execution role to grant it internet routing permissions.
Cevap
Deploy a NAT Gateway in a public subnet of the VPC, route traffic destined for the internet through it, and ensure the Lambda function's security group allows outbound HTTP/HTTPS traffic.
The correct options involve deploying a NAT Gateway in a public subnet and configuring the private subnet's route table to direct internet-bound traffic () to it, while also verifying that the Lambda function's security group allows outbound egress traffic on web ports. This ensures both routing and firewall policies allow the Lambda function to reach the external HTTP API.
Adım Adım Çözüm
Anahtar Kavram
Lambda VPC networking requires a NAT Gateway for outbound internet access from private subnets.