'Added VPC endpoint but Lambda still timing out

Goal: Lambda function needs to retrieve RDS password from Secret Manager via VPC Endpoint (using AWS-SDK in Lambda).

Problem: The Lambda function and RDS are in a VPC, hence why I created the endpoint to use AWS Services but my Lambda is still timing out. DNS Hostname is enabled on my endpoint and the role attached to my Lambda function has the LambdaVPCExecutionRole attached to it.

Is there anything I have missed? A lot of documentation mentions I need a NAT gateway but don't want to spend $33 a month if I don't have to!



Solution 1:[1]

I have encountered this exact error using the same setup. I was able to fix it by changing the security group of the VPC Endpoint to not be the default security group.

For some reason, the default security group was not passing through the traffic even though there was no rules restricting traffic.

I created a new security group with virtually the same configuration, associated that with the VPC Endpoint, and it worked.

Solution 2:[2]

I was able to fix this by associating the VPC endpoint with a security group that allow inbound access for all the traffic from the VPC CIDR.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Nate Jombwe
Solution 2 java_doctor_101