Home > OS >  How to make https request from a lambda function which is in a private VPC?
How to make https request from a lambda function which is in a private VPC?

Time:12-09

I currently have a lambda function which is inside a Private VPC because I am using it to access a ElasticCache Redis Cluster. However, I am unable to make https requests because of the private VPC. I have greated a NAT gateway with one of the subnets but all https requests time out. Should I be creating a second lambda function? How should I be doing this?

CodePudding user response:

The configuration should be:

  • NAT Gateway connected to a public subnet
  • AWS Lambda function connected to a private subnet
  • Private subnet Route Table configured to point to the NAT Gateway for 0.0.0.0/0 destination
  • Security Group on the Lambda function with "Allow All" Outbound rules

CodePudding user response:

Adding ip address of the server you are trying make an https to, to the outbound rules of the security group might help. The outgoing request must've been disabled.

  • Related