Consul Server on AWS ECS Fargate

Hi everyone!

I’ve been doing some research this week into this topic, and I can’t quite find the right solution, so I’m interested in hearing from anyone who has maybe overcome this before.

I have a consul environment currently running on EC2 servers. I have recently moved the application, consul-agents from EC2 servers to AWS ECS Fargate. Now, there is a service which contains a core-application containers and consul-agent, consul-template etc… runs as the sidecar container.

Now I am wondering if I can move the Consul-master servers(currently 3 EC2 servers) from EC2 to ECS fargate. If possible, what might be the scenario? Do I need to run consul-server in a completely different ecs fargate cluster?

I’d love ANY assistance that I can get on this topic so I can try to move my project forward.

Hi @deependra97,

Currently we do not recommend attempting to run Consul servers on ECS due to concerns around the performance of persistent storage backend available on ECS, which as far as I know is only EFS.

That said, I saw your posts on StackOverflow [1] and Twitter [2] about this same topic. It seems like running Consul on ECS Fargate is a high priority for you. Would you willing to share more info on the scale of your environment, or perhaps speak to our team to discuss your use case in detail?

Our team is actively exploring opportunities to better support running Consul clients on ECS. We recently published a tutorial for deploying Consul clients on ECS w/ EC2 instances (Connect an Amazon Elastic Container Service Cluster using EC2 Instances to HCP Consul | Consul - HashiCorp Learn), and are now investigating how to improve this provisioning workflow and also support deploying Consul clients on Fargate instances.