2 Answers
- Newest
- Most votes
- Most comments
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.
Relevant content
- asked 4 years ago
- Accepted Answerasked a year ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a year ago
Yes! Need secret manager service endpoint. Thanks!