Auto Scaling Groups
Explore how AWS Auto Scaling Groups help maintain high availability by automatically scaling EC2 instances according to traffic demands. This lesson covers launch templates, various scaling policies including dynamic and predictive scaling, lifecycle hooks, and advanced configurations like suspension processes and termination policies. Gain practical insights to deploy, monitor, and optimize scalable AWS infrastructure effectively.
Introduction
Using a single EC2 instance doesn’t provide higher availability. If there are issues in the AZ, host, or software of this EC2 instance, it’ll go down, and so will our web page application. We have also not scaled our EC2 instances in any way.
In real life, the traffic load on the application can change, so our website should have the capability to scale out in times of high load and scale in at times of no or less load.
Auto Scaling groups (ASGs) allow us to host an application on multiple servers that can scale in and out automatically. It also registers and deregisters instances in load balancers as instances are added or removed.
Using ASGs is free. We just have to pay for the resources (like EC2 instances) they create.
Launch templates
Launch templates hold the configuration information to launch EC2 instances. When creating an ASG, we need to specify a launch template that will be used by this ASG to create new instances as needed. We can also launch individual instances from launch templates. Launch templates hold configuration information like instance type, AMI, EBS volumes, and security groups for the EC2 instances.
Scaling policies
ASGs have scaling policies that define how and when they should launch or terminate instances.
Dynamic scaling policies
These can scale ASGs up or down based on preconfigured alarms and rules.
Target tracking
The target tracking policy simply works like a thermostat. For example, we can define that we want the average CPU utilization of EC2 instances to be 60% in a target-tracking scaling policy. The ASG will automatically launch and ...