I have a nodejs function on AWS Lambda that runs multiple setTimeouts within Async Parallel. Some are instant and some could be in 30min+ from now. The problem I am running into is that It will never get to the 30min timeout because it is going idle and then dies. Is there anyway to keep the lambda function alive while it is waiting to fire off the other timeout functions.
The lifetime of a Lambda is maximum of 900 seconds.
See: AWS Lambda Limits
There is no way to increase it beyond 900 seconds. When Lambda was introduced, the maximum execution time was 60 seconds. It was later increased to 300 seconds, then 900 seconds.
You need to revisit your design and check if Lambda is the correct solution. Running an on-demand EC2 instance that matches Lambda specifications could be a solution. Or state your problem, and we can propose a solution.