I am new to the AWS ECS. I am trying to understand Tasks and EC2 instances in the context of ECS Autoscaling. I have one Task definition. This means that when the Task is created under a service, there will be one EC2 instance. Suppose if the service needs to be scaled out through autoscaling. What happens in this scenario?. Following are my queries:
1) If I have mentioned 1 EC2 instance in the Cluster setting, what will happen to the autoscaling? Will it create a new EC2 instance?
2) Can autoscaling create two tasks in the same EC2 instance if there is enough free resource in the 1st EC2 instance? If so, What will happen to the port, because now there will be two tasks with the same port mapping.
3) This is not related to the Autoscaling, but if I have two different task definition with the same port name. Does it mean that these tasks will run on two different EC2 instances in the cluster?