‫So now let's talk about a very handy feature
‫of Auto Scaling groups called Instance Refresh.
‫So the idea is that you want to update
‫an entire Auto Scaling group
‫thanks to a new launch template that you've created.
‫And so you wanna re-create all EC2 instances.
‫For this, you can, instead of terminating an instance
‫and waiting for it to come back,
‫you can use the native feature of Auto Scaling groups
‫called Instance Refresh.
‫So let's take an example.
‫Say we have an Auto Scaling group
‫and the EC2 instances have been launched
‫with an old launch template.
‫I say old because we are creating a new launch template.
‫For example, we updated the underlying AMI
‫of our EC2 instances,
‫and then we're going to the API call
‫named Start Instance Refresh.
‫So what's going to happen is
‫that we're going to set a minimum healthy percentage,
‫for example, 60%,
‫and that tells our Auto Scaling group
‫how many instances can be deleted over time.
‫And then as instances are terminated,
‫then new ones are coming up with the new launch template.
‫That's why it's called an EC2 Instance Refresh,
‫is because instances are being terminated
‫and new ones come up.
‫And over time, all instances having the old launch template
‫will be terminated and the new ones will come up.
‫So on top of it, to make sure that your EC2 instances
‫have enough time to be ready and to serve traffic,
‫you can specify a warm-up time,
‫which is to say how long to wait until we can assume
‫that the new EC2 instance is ready to use.
‫Okay? So that's it for this lecture.
‫I hope you liked it and I will see you in the next lecture.