Search code examples
amazon-web-servicesaws-auto-scaling

Clarification for AWS auto-scaling of instances


I created an EC2 instance; then using that instance created an AMI which is used for auto-scaling. I created the classical load balancer which originally pointed just to the original instance & this load balancer is used in creating the auto-scaling as well. The settings of the auto-scaling are:

  1. Desired no. of instances:- 1
  2. Minimum no. of instance:- 1
  3. Maximum no. of instances:- 4

Now, the original instance is already running & the auto-scaling is creating another instance - I want (at this point) to run only one instance (that's my original instance) but a new instance is being created, making it 2 instances running at a time.

Does it mean that AWS auto-scaling checks the desired/minimum/maximum no. of instances running from the AMI group provided? Other instances (which were not created from the AMI such as the original instance) are not considered?


Solution

  • Does it mean that AWS auto-scaling checks the desired/minimum/maximum no. of instances running from the AMI group provided? Other instances (which were no created from the AMI such as the original instance) are not considered?

    Sort of... What it means is that the auto-scaling group only knows about instances that it has created. It didn't create the original instance, so it doesn't know about it. If you want the original instance to be included in the auto-scaling group, you have to attach that instance to the auto-scaling group.

    Just note that once you attach an instance to an auto-scaling group, the auto-scaling group could decide to terminate that instance. As noted in the Considerations for Attaching Instances section of the documentation.