ECS Task with Fargate container

AWS Step functions integration with ECS Task with Fargate container

AWS Lambda is an AWS service that allows users to run code without the need to provision or manage servers. ECS is another AWS service that provides containerized compute capacity, which can be used to run applications or services.
When combining Step Functions with Lambda and ECS, it is possible to create workflows that are executed in a serverless and scalable environment. The main advantage of this approach is that it allows users to create complex workflows that can be executed in a reliable and cost-effective manner. However, there is a challenge with using Lambda functions in Step Functions workflows: the maximum execution time for a Lambda function is 15 minutes. This can be a problem for workflows that require longer execution times.
To overcome this challenge, it is possible to use ECSTask to run the long-running tasks. ECSTask allows users to create containerized tasks that can run for much longer periods than a Lambda function. When a task needs to be executed, Step Functions can trigger an ECSTask to run the task, passing any necessary input or configuration data to the task.
In summary, combining Step Functions with Lambda and ECSTask provides a powerful tool for creating complex, serverless workflows. By leveraging the strengths of each service, it is possible to create workflows that are reliable, scalable, and cost-effective.

< Back to all workflows

GitHub icon View this workflow on GitHub


Clone repo

git clone https://github.com/aws-samples/step-functions-workflows-collection/tree/main/sfn-fargate-dotnet-cdk/cd step-functions-workflows-collection/sfn-fargate-dotnet-cdk

Deploy

cdk apply


Testing

See the GitHub repo for detailed testing instructions.

Cleanup

1. Delete the stack: cdk destroy.

Created by:

Uma Shankar

Uma Shankar

Application Development Consultant at AWS Professional Services.

Follow on LinkedIn