Okay, so let’s go into a quick demo in the AWS console to see how this works. So here I have a simple Auto Scaling Group, which only has one instance here. I only have one instance running and my current capacity is one and I want a minimum of one. And if I take a look into here, in instance management, I can see that I have a warm up pool with zero instances here. And you can see that I don’t have any instances yet. So I will be adding this configuration. And also I will be adding lifecycle hooks here just for you guys to see how this works. Okay, first of all, I will just create a simple lifecycle hook, which I’m going to call it demo and I will use the lifecycle hook whenever the instance is being launched. I will just wait 30 seconds, which is the minimum in this case, just to mark an application being ready, whenever the instance is being launched. And my default result instead of abandon if I do abandon the instance will be terminated. So I will continue. So the instance will be ready after 30 seconds. The lifecycle hooks as you guys know, we can manage them using the AWS CLI in order to sync the lifecycle hook that the application or the instance is ready to be part of the Auto Scaling Group. So in this case, I will just be waiting 30 seconds and the instance will be ready just to simulate that the application is getting ready into an instance So we’ll create the lifecycle hook and I have it here. And I will just provision some instances here for my warm up pool. This case, I will just do a quick TerraForm here. I will just say that I want a minimum of one, which is the same minimum that I have for my Auto Scaling Group, and I will do a maximum of seven, which is the max size I have in my Auto Scaling Group. And I will just do this and apply these changes to my Auto Scaling Group. So, the idea here is that I’m going to start adding instances into my warm up pool. And I will see that in this case, I will have six instances here. Because what I saw from how this warm up pool works is that the instances in the warm up pool will always be the difference between the minimum capacity that I have and the maximum capacity that I have in my Auto Scaling Group configure. So let’s wait for a little bit. So here, you see some instances are being launched. In this case, I will keep my instances running, I could be changing these two to stop, but I will keep them running. And if you see here, I haven’t touched lifecycle hooks. So we will take a look at that whenever the instance has been launched, the lifecycle hook will be the instance will be waiting for the signal from the lifecycle hook in order to go into a running state in the warm up pool. So you see here, some of the instances are already waiting to be configured or to be ready. In this case, I’m just mocking the server configuration with the lifecycle hook. And whenever these instances are ready, they will be in a running state. Warm with running state, which I can start using them into and adding capacity into my Auto Scaling Group. So let’s wait for a little bit. Okay, in the meantime, I will just show how we see the configuration in the AWS web console. So here, you can see this is the configuration for adding a warm up pool. It’s important to notice that we can only have one warm up pool per Auto Scaling Group. So in this case, I keep my instances running so we can have it in a stop state. And I can set up the minimum number of instances that I have in my warm up and also what is the max capacity that I want to give into my warm up pool. I can either choose to always equal the Auto Scaling Group max capacity in this case. Because I used TerraForm, I had seven, add it into the maximum. Okay. So if you see here, some of the instances went from waiting into running here proceeding in state, some of them are being ready. And soon all of them will be running. So we see that we have six instances already warmed up and running. And we can have them ready to be part of an Auto Scaling Group. So let’s do that. Okay. So in this case, I will just be adding two more instances into my Auto Scaling Group. And in this case, instead of the Auto Scaling Group going to launch like a new instance from scratch, I already have servers running. The Auto Scaling Group will go to the pool and use two of the instances. In this case, one of the instances that I already have running in order to increase the capacity for my Auto Scaling Group. Let’s wait for a little bit.
As you can see, here, we have one less instance from the warm up pool. And we have one instance which has been added into the Auto Scaling Group just to be already ready to serve traffic into my Auto Scaling Group. So, in this case, if I want to add more, I will be adding more instances here, more minimum capacity here. And in this case, you also see the lifecycle hooks run whenever an instance is being added into the Auto Scaling Group, just to mock that the instance can be ready. And we see that the instance is already serving traffic for our Auto Scaling Group. So in this case, if I want to add more or increase the capacity in the Auto Scaling Group, what we’ll do is just grab the instances from the warm up pool and add them into the Auto Scaling Group. So this is how warm up pools work.