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 個答案
0
已接受的答案

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
專家
Uri
已回答 1 個月前
profile picture
專家
已審閱 1 個月前
  • Yes! Need secret manager service endpoint. Thanks!

0

Yes, you can use VPC endpoint.

profile pictureAWS
專家
已回答 1 個月前

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

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

回答問題指南