My team is developing an application which consist of 20 microservice, This will be deployed in aws ecs ec2 instance. I am planning to launch 3 aws ec2 instance in the cluster. Each microservice will have its on task definition and service.
docker container is build, pushed to aws ecr and then deployed to ecs via jenkins using Jenkinsfile. In the taskdefinition json files I have set the host port to 0 so that each docker container host port will be random and there wont be any port conflict if we increase the desired count of a service to 2 or more.
I guess the containers on same task definition can be communicate using links but in my case we cannot predict on which instance the docker containers are.
If we use rabbitmq on a different server how it can talk with the different microservice? I am using the Network Mode as "default network" in taskdefinition, should I change that to awsvpc?