Configure Lambda without NAT for trigger API Gateway and use DocumentDB

0

It's possible, without NAT, use a Lambda from API Gateway and lambda need to access on DocumentDB?

Now I use NAT and I invoke Lambda from API Gateway. If I remove NAT, API Gateway go to timeout and I see on Lambda's log, timeout hit.

From Lambda I don't need internet access. I need to use only DocumentDB.

2 Risposte
0
Risposta accettata

You do not need a NAT Gateway to invoke a Lambda function from API Gateway (or anywhere else). You need a NAT Gateway only if yout VPC attached Lambda needs to access resources outside the VPC.

In your case you attached the Lambda to the VPC because it needs to accesss DocumentDB, but you are probably trying to access some other AWS service, such as Secrets Manager, or Dynamo or S3, etc. To access other AWS services, you should either use a NAT Gateway, or better yet, a VPC Endpoint for the specific service you need to access.

profile pictureAWS
ESPERTO
Uri
con risposta un mese fa
profile picture
ESPERTO
verificato un mese fa
  • Yes! Need secret manager service endpoint. Thanks!

0

Yes, you can use VPC endpoint.

profile pictureAWS
ESPERTO
con risposta un mese 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