---
layout: docs
page_title: Consul on AWS Elastic Container Service (ECS) Overview
description: >-
  You can deploy Consul service mesh applications to Amazon Web Services ECS by running each task with an application container, a client agent, and an Envoy proxy. Learn how Consul service mesh works on ECS and find getting started tutorials for several scenarios.
---

# Consul on AWS Elastic Container Service (ECS) overview
This overview provides information about connecting your workloads managed by [AWS Elastic Container Service (ECS)](https://aws.amazon.com/ecs/) to a Consul service mesh. A Consul service mesh automates service-to-service authorization and encryption across your Consul services. You can use a service mesh in ECS networks to secure communication between ECS tasks and communication between tasks and external services.


## Workflow 

You can install Consul on ECS with the [HashiCorp Terraform modules](/consul/docs/ecs/deploy/terraform) or by [manually configuring the task definition](/consul/docs/ecs/deploy/manual). We strongly recommend using the Terraform modules and resources because Terraform automatically builds and enables Consul service mesh containers for your workloads. The Terraform module installation method also allows you to add your existing ECS task definitions to the Consul service mesh without additional configuration. 

### Terraform module installation 

1. Create and run a Terraform configuration that includes the ECS task, modules, and resources. 
1. Configure routes between ECS tasks in your cluster. Once the service mesh is built, you must define paths for traffic between services.
1. Configure the ECS bind address. Binding to the loopback address allows the sidecar proxy running in the same task to only make requests within the service mesh.


### Manual installation

To manually install Consul, you must create definitions for each container that operates in the ECS cluster. Refer to [Architecture](/consul/docs/ecs/architecture) for information about the Consul containers you must deploy. Note that there is no manual process for creating gateway task containers. Gateways enable you to connect multiple datacenters or admin partitions. You must use Terraform if you want to deploy gateways to your network.

## Guidance

Refer to the following documentation and tutorials for additional guidance.

### Tutorials

- [Integrate your AWS ECS services into Consul service mesh](/consul/tutorials/cloud-integrations/consul-ecs): Shows how to use Terraform to run Consul service mesh applications on ECS with self-managed Enterprise or HCP Consul Dedicated.

You can also refer to the following example configurations:

- [Examples on GitHub](https://github.com/hashicorp/terraform-aws-consul-ecs/tree/main/examples)
- [Consul with dev server on ECS using the Fargate launch type](https://registry.terraform.io/modules/hashicorp/consul-ecs/aws/latest/examples/dev-server-fargate) 
- [Consul with dev server onn ECS using the EC2 launch type](https://registry.terraform.io/modules/hashicorp/consul-ecs/aws/latest/examples/dev-server-ec2)

### Documentation
 
- [Install Consul on ECS with Terraform](/consul/docs/ecs/deploy/terraform)
- [Configure routes between ECS tasks](/consul/docs/ecs/deploy/configure-routes)
- [Configure the ECS task bind address](/consul/docs/ecs/deploy/bind-addresses)
- [Install Consul on ECS manually](/consul/docs/ecs/deploy/manual)

### Reference

- [Architecture](/consul/docs/ecs/architecture)
- [Technical specifications](/consul/docs/ecs/tech-specs)
- [Task configuration reference](/consul/docs/ecs/reference/configuration-reference)
- [Cross-compatibility reference](/consul/docs/ecs/reference/compatibility)
- [Consul server JSON schema reference](/consul/docs/ecs/reference/consul-server-json)