How do I troubleshoot timeout issues with a Lambda function that's in an Amazon VPC?
Last updated: 2021-09-09
My AWS Lambda function returns timeout errors when I configure the function to access resources in an Amazon Virtual Private Cloud (Amazon VPC). How do I troubleshoot the issue?
Confirm that there's a valid network path to the endpoint that your function is trying to reach. To review your network settings, follow the instructions in How do I give internet access to my Lambda function in a VPC?
Important: If you're using a custom Dynamic Host Configuration Protocol (DHCP) options set, confirm that your custom DNS server is working as expected.
When you review your network settings, make sure that the following settings are configured correctly:
- Route tables
- Security groups
- Network access control lists (network ACLs)
- Domain Name System (DNS) hostnames and DNS resolution
If you're using an AWS SDK, then see if the SDK throws any relevant errors that can help you determine what's causing the timeouts.