Using a dotnet core Lambda function to trigger a long running FARGATE task

Introduction

AWS Lambda functions are great for doing small units of work. And not that they support dotnet core 2.0, they’re my go to choice for queue based workloads.¬†However, there are some tasks that will definitely take longer than the 5 minute limit on Lambda functions. For example, if you have a daily batch job that you need to run, and if that job is going to take 30 minutes, or a hour, then how are you going to set up that process? You could do something like setup a stand-alone EC2 instance, create a cron job to trigger it, etc. But then you’re having to manage infrastructure. I’d rather let Amazon worry about that.

FARGATE

Amazon has had docker support for a while, which gets close to solving our server problem. Initially you needed to create EC2 instances and attach them to the Elastic Container Service. More recently they’ve launched FARGATE which is a serverless way to run docker. You just specify the requirements of your task, and FARGATE will manage the infrastructure for you. A typical case is that you want to have a docker enabled website that you’ve built, and you can let FARGATE host it without ever having to provision an EC2 instance.

Continue reading Using a dotnet core Lambda function to trigger a long running FARGATE task