AWS Auto Scaling Group

AWS Auto Scaling Group

Table of contents

No heading

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.

  1. Create an AMI for the existing instance. The instance, you want to scale.

  2. Create the Auto Scaling Group; select “Launch Configurations” from the side menu.

    1. Select the AMI, type of instance you want to be created by Auto Scaling group.

    2. Assign a name to the launch configuration.

    3. Select the existing security group as that of the master instance.

    4. Create launch configuration.

  3. 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.”

  4. Determine the maximum number of possible instances in the group

  5. 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.

  6. 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.