Configure ECS container to be bind to an existing LB Listener, responding to a specific URL #1426
Description
Having one LB per container in ECS is too expensive, so we have a separate Cloudformation stack that defines a load balancer that receives requests from a bunch of different domain names and forwards requests to specific ECS container groups depending on the domain name by using lb listener rules (forwarding by host header).
For example, https://test1.example.com and https://test43.example.com both arrives at the same AWS LB, on the same :443 listener that uses a previously provisioned wildcard certificate. In this listener we have two rules, one that forwards requests to a service container group "test1" if "Host" header is "test1.example.com" and another that forwards requests to group "test43" depending on the "Host" header request.
This was the best way we managed to cut some costs but still having separate domains for each container (we have a lot of differente containers running).
How could we do something like this using compose-cli?