A serverless Lambda function running inside a VPC must call an external provider that accepts requests only from a single public IPv4 address (the provider will allowlist that address). You must supply one public IP to the provider so the Lambda-based application can use the service. Which solution provides the required single public IP for outbound requests from the Lambda function?
Choose an answer
Tap an option to check your answer.
Correct answer: Create a NAT gateway, assign an Elastic IP to the NAT gateway, and configure the VPC subnets used by the Lambda function to route outbound traffic through that NAT gateway..
Why this is the answer
The correct solution is to create a NAT Gateway with an associated Elastic IP and configure the Lambda function's subnets to route outbound traffic through it. A NAT Gateway allows instances in private subnets (like a Lambda function within a VPC) to connect to the internet or other AWS services while preventing inbound connections from the internet. The Elastic IP assigned to the NAT Gateway provides the single, static public IP address required by the external provider for allowlisting. Incorrect options: An egress-only internet gateway is for IPv6 traffic only and does not provide a static public IPv4 address for outbound connections. Attaching an internet gateway and associating an Elastic IP with it does not provide a static outbound IP for a Lambda function in a private subnet; an internet gateway is for direct internet access for public subnets. Lambda functions in a VPC typically run in private subnets for security. Setting the default route in a public route table to use an internet gateway is for instances in public subnets, not for providing a static outbound IP for a Lambda function in a private subnet.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed