Home › AWS Developer Associate › cloudcomputing › awsdevelopment › Which strategy allows a Lambda function inside a…
Which strategy allows a Lambda function inside a VPC to access the internet (e.g., to call a third-party API) while keeping the function's ENI private?
AHave the function call the API via Amazon Glacier
BPlace the Lambda in a private subnet and route its egress through a NAT Gateway in a public subnet
CDisable VPC integration so Lambda runs without networking
DAttach a public IP address directly to the Lambda function's ENI
Answer & Solution
Correct answer: B. Place the Lambda in a private subnet and route its egress through a NAT Gateway in a public subnet
VPC-bound Lambda functions don't get public IPs — outbound internet requires a NAT Gateway in a public subnet with a route from the function's subnet. Direct public IPs aren't a Lambda option; disabling VPC integration removes private-resource access; Glacier isn't a proxy.
Related questions
A Lambda function reads from a Kinesis Data Stream. Throughput is fine on average but spikAn API Gateway REST API in front of Lambda needs to authenticate requests using a Cognito A serverless app needs to fan out a single event to multiple downstream Lambda functions, A Lambda function processes a large file from S3. Cold starts are unacceptably long on JavWhich AWS feature lets developers attach short-lived AWS credentials to a Lambda function What does it mean for an API endpoint to be IDEMPOTENT?A Lambda function is processing messages from an SQS queue. Some messages fail repeatedly.Which Lambda configuration setting most directly affects the function's CPU and network pe