Auto Scaling groups – Amazon EC2 Auto Scaling

Auto Scaling groups

Note

If you are new to Auto Scaling groups, you can learn more in the Get started with Amazon EC2 Auto Scaling tutorial. You start by creating
a launch template or a launch configuration and then use it to create an Auto Scaling group in
which all instances have the same instance attributes. For example, you can set the
following instance attributes by specifying them as part of the launch template or
launch configuration: Amazon Machine Image (AMI), instance type, block storage devices,
SSH key pair, and security groups that control the inbound and outbound traffic for an
instance.

An Auto Scaling group contains a collection of EC2 instances that are treated
as a logical grouping for the purposes of 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.
Both maintaining the number of instances in an Auto Scaling group and automatic scaling are the core
functionality of the Amazon EC2 Auto Scaling service.

The size of an Auto Scaling group depends on the number of instances that you set as the desired
capacity. You can adjust its size to meet demand, either manually or by using automatic
scaling.

An Auto Scaling group starts by launching enough instances to meet its desired capacity. It
maintains this number of instances by performing periodic health checks on the instances in
the group. The Auto Scaling group continues to maintain a fixed number of instances even if an
instance becomes unhealthy. If an instance becomes unhealthy, the group terminates the
unhealthy instance and launches another instance to replace it. For more information, see
Health checks for Auto Scaling instances.

You can use scaling policies to increase or decrease the number of instances in your group
dynamically to meet changing conditions. When the scaling policy is in effect, the Auto Scaling
group adjusts the desired capacity of the group, between the minimum and maximum capacity
values that you specify, and launches or terminates the instances as needed. You can also
scale on a schedule. For more information, see Scale the size of your Auto Scaling group.

An Auto Scaling group can launch On-Demand Instances, Spot Instances, or both. You can specify
multiple purchase options for your Auto Scaling group only when you use a launch template. We
recommend using launch templates instead of launch configurations to make sure that you can
use the latest features of Amazon EC2 Auto Scaling and Amazon EC2.

Spot Instances provide you with access to unused EC2 capacity at steep discounts relative
to On-Demand prices. For more information, see Amazon EC2 Spot Instances. There are key
differences between Spot Instances and On-Demand Instances:

  • The price for Spot Instances varies based on demand

  • Amazon EC2 can terminate an individual Spot Instance as the availability of, or price
    for, Spot Instances changes

When a Spot Instance is terminated, the Auto Scaling group attempts to launch a replacement
instance to maintain the desired capacity for the group.

When instances are launched, if you specified multiple Availability Zones, the desired
capacity is distributed across these Availability Zones. If a scaling action occurs,
Amazon EC2 Auto Scaling automatically maintains balance across all of the Availability Zones that you
specify.

Alternate Text Gọi ngay