1 Answer
- Newest
- Most votes
- Most comments
1
Hi fmdev,
Please try thie solution it will be helpful for you.
Step:1 Verify VPC Configuration:
Subnets and Route table
1. the Lambda function is placed in the correct subnets.
2. Verify that these subnets have route tables configured to direct traffic to the
NAT Gateway, Internet Gateway, or VPN gateway if needed.
Step:2 Check Security Groups:
Outbound Rules for Lambda:
1.the security group attached to the Lambda function allows outbound traffic on
the necessary ports to your on-premises database.
Inbound Rules for Database:
1.on-premises database's firewall/security group allows inbound traffic from the
IP range of your VPC or the specific IP address if you're using a NAT Gateway
with a static IP.
Step:3 NAT Gateway and Internet Gateway:
Setup NAT Gateway:
1.If your Lambda function needs internet access (to download dependencies),
ensure it is configured to route through a NAT Gateway in a public subnet.
Configure Route Tables:
1.the route tables in the private subnets where your Lambda resides route
internet-bound traffic through the NAT Gateway.
Please look at AWS Document Link you will get more information.
https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html
Relevant content
- asked a year ago
- asked 3 years ago
