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

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
EXPERTE
Uri
beantwortet vor einem Monat
profile picture
EXPERTE
überprüft vor einem Monat
  • Yes! Need secret manager service endpoint. Thanks!

0

Yes, you can use VPC endpoint.

profile pictureAWS
EXPERTE
beantwortet vor einem Monat

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