How to assign services by label

Hey there,
I am trying to use traefik as a way to make a pool of php servers using ECS to handle scaling and deployment, but when containers are made in ecs they are given a random name is there a way to tell traefik by a label that x container is for x service. Any help would be greatly appreciated.