Say I have an autoscaling group with initial number of 2 instances. Assume that instances of this autoscaling group would be of the same type (hence the same amount of memory and CPU). The maximum number of instances isn't relevant in this case. Also I have an ELB which load-balancing load among instances of this group. Besides this, instances of this autoscaling group are members of some fresh ECS cluster I've created earlier. There is only one task definition in this case with only one container which would use 512Mb of RAM. Also this container requires port mapping from host's 80 to container's 5000.
Say I've spun up this autoscaling group and 2 initial instances are now ready to be used. Then I'm trying to spawn a service of 4 tasks based on the aforementioned task definition. Imagine that this tasks would perfectly fit this 2 instances if they were placed by two (if the hosts had 1Gb of RAM each).
Would this setup even be legitimate? If so then what would happen with port mappings because there would be 2 identical containers on one host?