I have some lambda functions in a VPC, some of them need Internet to work so I added a NAT instance (t2.micro) and the problem is that I have some functions sometimes work and sometimes timeout. For example a function that call FB API 80% of the time work and 20% timeout. Another function is using boto3 to create a spot instance 50% of the time timeout and the logs give me.
2018-07-16T06:35:55.909Z 421f98dd-88c2-11e8-913a-63c8d6f276f3 Task timed out after 100.10 seconds
Whenever I redeploy my serverless project I face this problem.
I increased the timeout limit and the memory but I have the same problem I'm sure that there is access to Internet but some of the lambda functions timeout.
What do you think the problem is ? Thanks