Overview
The most common AWS deployment of Mage is with AWS ECS. Our Terraform scripts manage the process of creating an ECS cluster, a load balancer, and a database. Here’s a link to the default output ofterraform plan
on AWS ECS.

An architecture diagram of a Mage AWS ECS deployment.
Elastic Container Service (ECS)
Amazon ECS is a service provided by AWS for managing and deploying containerized applications. The ECS service in Terraform is used to define and configure the ECS clusters and services. ECS allows you to run containers at scale, and the Terraform configuration for ECS service includes specifying the task definition, desired task count, launch type, and other settings related to container orchestration. The Mage application runs as multiple containers in an Amazon ECS service.Application Load Balancer (ALB)
An Application Load Balancer is a service provided by AWS that distributes incoming application traffic across multiple targets, such as EC2 instances, ECS containers, or Lambda functions. In Terraform, the ALB resource is used to define and configure the load balancer, including listeners, target groups, and rules for routing incoming requests to the appropriate backend targets. Our ALB is configured to route traffic to the ECS cluster and provides a public URL for communication with clients. Read more here.Elastic File System (EFS)
Amazon EFS provides a fully managed, scalable, and shared file storage service that can be used with AWS services and on-premises resources. We use EFS to store a persistent volume where themage_data
for your project is stored. You can learn more about what is stored in mage_data
here. Without EFS, your project data would be lost when your ECS service is terminated. EFS allows us to persist data between containers within ECS.