ECS Fargate starts on a different IP on a new task - how to manage it?
What is the best practice to handle only 1 running task and connect it to a domain. I can't use the IP directly because changes on every task restart.
The best option, don't confused with the cheapest, is to run tasks in an ecs service, rather then individually. If you have service running, you can associate network load balancer (NLB) with it.
The reason for using NLB is that it provides static public IPs for you, unlike application load balancer (ALB).
But if your aim is just to have a stable endpoint to use for a domain, then ALB should be enough.
However, using ALB or NLB is not free.
As a side note, there is a proposal for adding Elastic IP support to Fargate:
So hopefully, providing static address for a task in Farget will be easier.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With