ECS config discovery: "Router defined multiple times with different configurations"

Hi,

I'm deploying Traefik to AWS ECS to proxy traffic to ECS tasks that it finds through the ECS configuration discovery. It works perfectly when the task is running in a stable state, but during deployments (when there is >1 task instance) I get "Router defined multiple times with different configurations" errors.

The errors look like this

	
{"level":"error","providerName":"ecs","routerName": "router_name","configuration":["service-app_name-HASH_1","service-app_name-HASH_2"],"time":"2025-02-10T11:33:23Z","message":"Router defined multiple times with different configurations"}

I believe HASH_1 and HASH_2 are related to the two ECS tasks, but I can't be sure of that because they don't match up with any identifiers in the console.

The docker labels I attach to my running container looks like this

      dockerLabels = {
        "traefik.http.routers.app_name-${var.pull_request_number}.rule" : "Host(`pr-${var.pull_request_number}.app.domain`)",
        "traefik.http.routers.app_name-${var.pull_request_number}.service" : "app_name-${var.pull_request_number}",
        "traefik.http.services.app_name-${var.pull_request_number}.loadbalancer.server.port" : "3000",
        "traefik.http.services.app_name-${var.pull_request_number}.loadbalancer.healthcheck.path" : "/up",
        "traefik.enable" : "true"
      },

Is this just a known thing with ECS configuration discovery, or do I need to make my router and service names totally unique, perhaps by including a timestamp? The ultimate goal is to achieve a rolling deploy and as minimal downtime as possible.