amazon-web-servicesaws-lambdaamazon-vpcaws-nat-gatewayvpc-endpoint

can a lambda function inside a private subnet access aws services outside the vpc through vpc endpoints?


I am deploying an application where I am using a NAT gateway with a lambda inside a private subnet to talk to other AWS services outside the vpc. Everything is working fine but the NAT gateway adds alot of extra costs to the billing. I am assuming if I can replace the NAT gateway and use and interface vpc endpoint instead?


Solution

  • I am assuming if I can replace the NAT gateway and use and interface vpc endpoint instead?

    Yes, you can do this. But please note that not all services have VPC interface endpoints. The list of such services is here.