Home / 

AWS Fargate, a fully managed compute engine for containers, provides a scalable, cost-efficient, and secure alternative to managing EC2 instances for AWS ECS clusters. Terraform is an Infrastructure-as-Code tool that allows you to define and provision cloud infrastructure resources using simple and declarative configuration files. By migrating to Fargate, businesses can save time and money while enabling development teams to focus solely on developing applications. This blog will explore how Terraform can automate your migration from EC2 to Fargate.

What is AWS Fargate?

AWS Fargate eliminates the need to manage servers or clusters and simplifies the process of building and deploying applications. Fargate supports Amazon ECS, Amazon EKS, and Amazon ECR to deploy container-based applications. It’s a serverless computing engine for containers without you having to provide an underlying EC2 instance for running containers. Serverless computing is an innovative cloud-based architecture that allows developers to build and run applications without managing infrastructure.

Fargate manages the underlying compute resources, allowing you to focus on building, running, and scaling applications. With Fargate, you can specify the CPU and memory resources needed for your tasks and applications. Fargate also supports auto-scaling, allowing applications to scale up or down based on demand.


Running ECS with Fargate eliminates the need to configure and scale any underlying EC2 instances. You create a cluster, add packaged application containers, specify the resource CPU and memory requirements, define networking and IAM policies, and launch the application. Each Fargate task has its own isolated space and does not share the kernel, elastic network interface (ENI), CPU, or memory resources with other tasks.