Docker integration with ECS

As mentioned ECS is just a wrapper around EC2 instances. with auto scaling.
a task starts one (more) a docker container(s) inside the ECS instances (EC2)

so, how would you write a script (task) to do this with EC2 instances?

I think you would create 3 services, (A+B), (C+D) and (E+F)

and you could use redis as the catalog of info on how to reach A from the other nodes.
the A+B host would be the redis server host.