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 Answers
0
Accepted Answer

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
EXPERT
Uri
answered 17 days ago
profile picture
EXPERT
reviewed 14 days ago
  • Yes! Need secret manager service endpoint. Thanks!

0

Yes, you can use VPC endpoint.

profile pictureAWS
EXPERT
answered 17 days ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions