amazon-web-servicesamazon-ec2autoscalingec2-amilaunch-configuration

What is the use of "Attach to Autoscaling Group" in AWS?


I'm sorry if it feels like a dumb question to you.But I have to know this.

What is the use of "Attach to Auto-scaling Group" in AWS?

Let me be more specific about this question.

Suppose I have an auto-scaling group with a launch configuration. Lets name it ABC-asg I used ami-12345 for that launch configuration. Now I have another instance from ami-56789. Lets name my instance xyz and I've installed some packages in it. I attached my instance xyz to the autoscaling group ABC-asg.But the new instances launched by that asg are using ami-12345.

My questions are

1.What is the use of attaching my instance to an existing auto-scaling group?

2.If it is about the "different ami" in my instance. So if I attach an instance with "same ami" will my packages replicated to the next instances launched by the asg?

Please someone help me with this question.


Solution

  • The Attach to Auto-scaling Group simply adds the given instance to the Auto Scaling group. This means the instance will be part of the group of instances that can receive traffic from a Load Balancer associated with the group and it also means that Auto Scaling might Terminate the instance when scaling-in a group.

    The only different between an instance attached to an Auto Scaling group in this manner is that it was not created by Auto Scaling.

    So, why have such a command? Here's a few scenarios:

    Attaching/detaching an instance in no way affects your Launch Configuration. Any additional instances launched by Auto Scaling will not be impacted by an attach/detach command -- they will launch using the existing Launch Configuration.