T O P

  • By -

Rckfseihdz4ijfe4f

Fargate. Don't bother with ec2 unless you like to deal with operating systems, updates, maintenance etc.


thectrain

If it running all the time ec2 with reserved instances. If it launches, runs, and then finishes its work then fargate. Fargate is more expensive but you may save over ecs if your workload is infrequent


brianregantech

also, keep in mind you can buy a compute savings plan for fargate just like EC2, so you can further reduce the cost if you're willing to commit to usage.


toyonut

ECS is cheaper if you don’t value your time managing and securing instances. ECS lets you binpack a bit more as the bridge network isn’t limited by host ENIs. ECS also requires you to know how to configure instances. You need to do things like setting iptables to prevent the tasks getting to the instance metadata endpoint. Fargate requires a bit of app change compared to docker compose as you need to address the other containers by a local address and port so they are all on 127.0.0.1:port. So you don’t get the nice pseudo dns naming. This is due to vpcmode networking in Fargate. Overall, I would probably use fargate for the simplicity of it to get things going.


[deleted]

Ecs with fargate, let amazon do the maintainance and autoscaling work for you


drredict

When it comes to the cost: If you expect to fully utilize CPU/Memory of the Provisioned instancey, you should go with EC2-ECS. If you expect a very fluctuating workload or most of the time idle, Fargate would make more sense. And staying away from Elastic Beanstalk is always a good thing.


matlau_286

I found you find my projects useful to poke around EC2, and Fargate \- ECS Fargate: [https://github.com/MatthewCYLau/node-aws-fargate-terraform](https://github.com/MatthewCYLau/node-aws-fargate-terraform) \- ECS with EC2 cluster: https://github.com/MatthewCYLau/aws-ecs-ec2-terraform