I am exploring the use of the new Fargate option for my ECS containers. One limitation is that a working task should always be available at the same public IP address.
My first thought was to allocate Elastic IP, but I canβt say what to associate it with. It seems that Elastic IP can be connected to an instance (which is not related to Fargate) or to a network interface. However, if I associate it with ENI, I donβt see how to ensure that my task container has this network interface. When creating a service, I see that I can put it in a VPC, but what is it.
From an experiment, if I kill a task so that the service restarts a new one, or if I update the service to start a new revision of the task, the container that starts the new task will each time have a new ENI.
Is there a way to ensure that this service has the same public IP address, even if its tasks are killed and restarted?
source share