Show HN: awslambdaproxy an AWS Lambda powered HTTP(s) web proxy
github.com
github.com
You have several options.
For many cases like that you should just have an EC2 instance that you run jobs on -- this is the simplest and there are already many tools for managing scheduled tasks like that.
You could also use a scheduled Lambda to start an EC2 instance/record task info in a DynamoDB table and another Lambda to check the status of the task periodically, shutting the instance down when it is done and updating the status. I've written a thing that does this and it works pretty well. You can also use spot instances for this to potentially save some $.
You can use ECS and kick off an ECS Task via a scheduled Lambda. This means learning some stuff about ECS and Docker.
Another interesting but much more complex (and probably not applicable) option is to break your task up into chunks that take less than 5 minutes, and just have Lambdas kick off more Lambdas for the next parts of the task.
You can also have Lambdas execute commands on EC2 instances. This makes it easier to run non-web-app code in response to various AWS events since most things can be hooked into Lambda. Maybe that is more along the lines of what you want?
https://aws.amazon.com/step-functions/
Basically a form of state machine using Lambda.
Personally, I'd prefer to just use a regular EC2 instance for long duration tasks, perhaps even spot instances to keep costs low.
You'd probably be better off having a small EC2 box that runs long processes than AWS Lambda if your processes can't be broken into 5 minute chunks.
I guess a lot of websites break from this, since web servers sometimes don't like traffic coming from different sources for the same "session".
* Anything that requires a long lived HTTP connection
* If you get unlucky and you load part of a web page while proxy is moving over to a new Lambda function