Practice free →
HomeAWS Developer Associatecloudcomputingawsdevelopment › 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.
Solve this in the app — AWS Developer Associate practice & 24k+ MCQs →
Related questions