Table of contents
No headings in the article.
An Auto Scaling group contains a collection of EC2 instances that are treated as a logical grouping for automatic scaling and management. An Auto Scaling group also lets you use Amazon EC2 Auto Scaling features such as health check replacements and scaling policies.
Why do we need auto scaling group?
Imagine traffic increases on your EC2 instance, what will you do?
You can either increase the existing system configuration like the CPU or RAM or create additional servers to handle the load/traffic.
The former type of scaling is called vertical scaling and the one in which you are adding additional servers is called horizontal scaling.
How to create Auto Scaling group so that whenever traffic increases it can add more servers and reduce when the load reduces.
Create an AMI for the existing instance. The instance, you want to scale.
Create the Auto Scaling Group; select “Launch Configurations” from the side menu.
Select the AMI, type of instance you want to be created by Auto Scaling group.
Assign a name to the launch configuration.
Select the existing security group as that of the master instance.
Create launch configuration.
The next thing is to configure the Auto Scaling group; Name the group of instances, determine the number of instances with which it will start, and select the VPC Press “Next: Configure scaling policies.”
Determine the maximum number of possible instances in the group
Add a new alarm for the increase of instances. In “Take the action” we establish that it increases the number of instances by 1 in 1.
Do the same to reduce instances.
Review the configuration and create the Auto Scaling group.
In a few minutes, you can see in “Instances” the instance that is created automatically.
That's how you create an auto scaling group, you can add load balancers as well to further distribute traffic to instances.