1 Answer
- Newest
- Most votes
- Most comments
1
Hello.
Is Lambda connected to VPC?
In that case Lambda Please configure NAT Gateway so that you can access "smtp.zoho.com" from.
When Lambda connects to a VPC, it requires a NAT Gateway to access the public internet.
https://repost.aws/knowledge-center/internet-access-lambda-function
Also, if Lambda does not need to connect to AWS services (EC2 or RDS) in the VPC, there is no need to connect to the VPC.
Relevant content
- asked 5 months ago
- asked 3 years ago
- AWS OFFICIALUpdated 4 months ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a year ago
Lambda is hosted on Public Subnet with Internet Gateway. Does I have to install a NAT gateway on this subnet??
Even if Lambda is placed in a public subnet, the ENI does not have a public IP address attached to it, so it must be routed to the public internet through a NAT Gateway. Therefore, you need to place Lambda in a private subnet and configure settings to route it via NAT Gateway.
Instead of creating a NAT Gateway (price USD67) I created a NAT Instance with EC2 t4g.micro (price USD6) and it works very well. Thank you!