Find answers, ask questions, and connect with our
community around the world.

Home Forums AWS AWS Certified Solutions Architect Associate Elastics Load Balancing concept clarity Reply To: Elastics Load Balancing concept clarity

  • Jon-Bonso

    Administrator
    May 19, 2020 at 8:50 am

    Hi Ishan,

    Thank you for posting your question. I understand your point here. You are saying that because the EC2 instance has been running for the longest time, then most likely, it would also have the oldest launch configuration. Yes, this is possible but not all the time.

    Take note that a launch configuration is an instance configuration template that an Auto Scaling group uses to launch EC2 instances. If you just launched an EC2 instance manually, then it is possible that it doesn’t have an associated launch configuration. You can also manually attach new EC2 instances in your Auto Scaling group. These newly attached EC2 instances can adopt the launch configuration of the Auto Scaling group:

    https://docs.aws.amazon.com/autoscaling/ec2/userguide/attach-instance-asg.html

    Therefore, the EC2 instance which has been running for the longest time in the Auto Scaling group, doesn’t always have the oldest launch configuration too. It depends on various factors, which is why the official AWS Documentation said that the primary attribute for terminating the EC2 instances for scale-in is the oldest launch configuration and not the longest-running instance.

    Amazon EC2 Auto Scaling also supports the custom termination policies, such as OldestInstance, which terminates the oldest instance in the group. I believe, this is what you are referring to here. For more information, please visit:

    https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-instance-termination.html#default-termination-policy

    Cheers,

    Jon Bonso @ Tutorials Dojo