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 Antworten
1
Akzeptierte Antwort

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
beantwortet vor 8 Monaten
profile picture
EXPERTE
überprüft vor 2 Monaten
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
EXPERTE
beantwortet vor 8 Monaten
0

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

profile picture
EXPERTE
beantwortet vor 8 Monaten

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen