Lambda And VPC

Pasted image 20221010133719.png

  • By default AWS Lambda is launched outside VPC. Therfore it cannot access VPC resources
  • You must define VPC ID, subnets and security group
    • Lambda then will create an ENI (Elastic Network Interface) in your subnets
  • You need AWSLambdaVPCAccessExecutionRole
  • Note: Deploying a lambda function in public subnet does not give it internet access or public ip
    • To have internet, you need deploy in private subnet and give it a NAT gateway or NAT instance
      Pasted image 20221010134005.png