1 Answer
- Newest
- Most votes
- Most comments
2
Hello.
Is Lambda connected to the same VPC as RDS?
If you are not connected, please connect to VPC by following the steps in the document below.
https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html#vpc-configuring
Make sure that you allow the Lambda function's security group connection in the RDS security group inbound rule.
https://repost.aws/knowledge-center/connect-lambda-to-an-rds-instance
Relevant content
- asked 7 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated 2 years ago
Lambda's VPC is connected to the RDS VPC via VPC peering I checked the security group, all traffic is allowed (for testing purposes)
Have you checked the route table of the subnet that Lambda is linked to? A route to the VPC peering must be configured in the route table. This requires that the route to the VPC peering be set in the RDS subnet route table as well. In other words, the settings must be configured to allow communication between VPCs in both directions.
I checked the VPC peering Connections in the "Edit DNS Setting" and it turned out that I wasn't enabling the "resolve DNS of requester VPC hosts to private IP." checkbox in both VPCs (Accepter VPC and Requester VPC) and this solved the issue , but am wondering why this checkbox solved the issue while in the inbound rules of the VPC I was allowing all Mysql aurora traffic Ipv4 connections along with the CIDR entries connections from the Peer VPC ?
The VPC needs to resolve public IPv4 DNS hostnames to private IPv4 addresses when queried from instances in the peer VPC. Here is more detail. https://repost.aws/knowledge-center/vpc-peering-troubleshoot-dns-resolution