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 Risposte
1
Risposta accettata

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
con risposta 8 mesi fa
profile picture
ESPERTO
verificato 2 mesi fa
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
ESPERTO
con risposta 8 mesi fa
0

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

profile picture
ESPERTO
con risposta 8 mesi fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande