So I am trying to get my AWS setup working with DNS.
I have 2 instances (currently). I have 4 task definitions. 3 of these need to run on port 80/443, however all on separate subdomains.
Currently if I stop/start a task, it can end up on either of my instances. This causes issues with the subdomain DNS potentially being pointed in the wrong places.
I imagine I need to setup some kind of load balancer to point the DNS at, but unsure how to get that to route through to the correct tasks.
So my questions:
- Do I need a single load balancer, or one per 'task / subdomain'?
- How do I handle the ports to go from a set source port, to one of any number of destination ports (if I end up having multiple containers running the same task)
- Am I over complicating this massively, or is there a simpler way to achieve this?