Http request timeout using VPC config

Hey guys, question, I’m having an issue with Amazon Lambda / Serverless.

I’ve created a HTTP lambda function in a private network using a VPC, that function makes a request to a wordpress service in the same network.

After some time I’m getting an Axios timeout error trying to connect to the wordpress service.

Do you have a clue about why I’m getting that timeout?

Thanks in advance!

Ahhh, VPCs… How’s your AWS networking? Because you’re about to learn a lot!

There are a multitude of things that can go wrong be unintuitive. Check the following things on both your source (i.e. Lambda ENI) and target (i.e. WordPress server - also an ENI technically):
1. Route tables between subnets that the ENIs are in.
1. NACLs on the subnets the ENIs are in. Remember that NACLs are stateless, so need rules going both ways.
1. Security Groups that are associated with the ENIs - check the corresponding ingress and egress rules on both sides.

Any one of those things that is misconfigured will cause a silent timeout.
If you’ve got VPC Flow Logs enabled for your VPC, you can check them out to see if the packets are being rejected (which could be because of either NACLs or SGs).