How to allow a Lambda that is inside a private VPC to make a GET request to a Regional API in API Gateway

0

I have a lambda that needs to be inside a private subnet in the VPC so that it can connect to a Neptune database, but by doing it I can't make a GET request from a Regional API from my API gateway, from the research I made it seems like I need to set a NAT Gateway to connect to a public subnet in order to be able to make the GET request that I need to do.

I'm asking this question to make sure that what I need to do is set up a NAT Gateway, and if so what would be the best way to do that, is this a good guide on how to do it?

If setting up a NAT Gateway isn't the best way to resolve my issues, what would be?

Thanks in advance

3 個答案
1
已接受的答案

If you want to grant internet access to your AWS Lambda function in a VPC (private subnet), set up a NAT gateway. Here is a great step-by-step guide.

AWS
Max
已回答 8 個月前
profile picture
專家
已審閱 2 個月前
1

HI, tomsantos. To avoid problems with missing something important please use official documentation about how to setup a nat gateway like https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html. Also please use this documentation https://docs.aws.amazon.com/lambda/latest/dg/services-apigateway.html to correctly setup lambda with API gateway. Best regards, Andrii

profile picture
專家
已回答 8 個月前
0

Hello. Could you please accept the answer if it helps you? Best regards, Andrii

profile picture
專家
已回答 8 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南