1

I'm currently trying to deploy multiple copies of a single solution on AWS EC2—each copy will have slightly different environment variables and will each sit on a unique EC2 instance (latency and performance considerations).

What would be the easiest/best way to achieve the above? To give some context, I am a back-end developer who primarily deploys on Docker, but with limited knowledge of Kubernetes. As of now, I've considered (a) manually deploying on each EC2 instance (which would be painfully cumbersome during each update), and (b) using ECS Docker Compose to deploy on AWS. For ECS, I haven't figured out yet how to limit each container to only one EC2 instance.

I do apologise in advance if this is a beginner question in terms of automated deployment—have limited experience in this area. Thank you very much for the help!

matt
  • 2,857
  • 7
  • 33
  • 58

1 Answers1

2

Have you considered ECS deployments to Fargate instead of EC2? I recommend checking that out as it will greatly reduce the complexity of deploying multiple containers with different settings, eliminating the need to manage the underlying host servers at all. You also mentioned using ECS Docker Compose, but that deploys to Fargate, not EC2.

If you are wanting to use ECS to deploy to EC2 instances, and you want one container per EC2 instance, then you would need to configure the Memory/CPU requirements for your containers to be such that only one could fit on each of your EC2 instances. Then ECS will automatically deploy them to separate instances. You'll have to find another method of deploying them than Docker Compose though. I highly recommend using Terraform for this sort of thing.

Mark B
  • 183,023
  • 24
  • 297
  • 295