AWS Auto Scaling Group (ASG) Introduction
What is AWS Auto Scaling Group (ASG)?
ASG is a collection of EC2 instances managed as a single unit, these EC2 instances is treated as a logical grouping for the purposes of automatic scaling and management.
In real-life, the load on our application can change, this is where ASG come into play. We can quickly scale up or down application servers.
The goal of an ASG:
Scale out (add EC2 instances) to handle increased load.
Scale in (remove EC2 instances) for the decreased load.
Ensure we have a minimum and maximum number of EC2 instances running.
Automatically register new instances to a load balancer.
It can re-create an EC2 instance in case the previous one is terminated.
ASG is free, we only pay for the underlying EC2 instances.
ASG Attributes
ASG Launch Template
It has Min Size/Max size / Initial Capacity
Scaling Policies (we specify some criteria when ASG should scale up or down, like: Average CPU, or custom metric): It is possible to scale an ASG based on CloudWatch alarms.