You must first create a scaling group and a scaling configuration to implement automatic scaling. A scaling group is a group of Elastic Compute Service (ECS) instances that provide the same service. A scaling configuration is a template used by a scaling group to create ECS instances. This topic describes how to create a scaling group, create a scaling configuration for the scaling group, and enable the scaling group. The minimum number of ECS instances in the scaling group is set to 1.

Prerequisites

A security group is created.
Note The security group and the scaling group must be in the same region.

Background information

After a scaling group is created, its region cannot be changed. For more information, see Regions and zones.

Step 1. Create a scaling group

In this example, a scaling group is created with simple settings. For more information about the parameters, see Create a scaling group.

  1. Log on to the Auto Scaling console.
  2. In the top navigation bar, select a region.
  3. Click Create Scaling Group.
  4. Configure the parameters for the scaling group.
    The following table describes the parameters used in this example. For parameters that are not described in the following table, use the default values.
    Configuration type Parameter Example Description
    Scaling Configuration Source Source Type Create from Scratch If you create a scaling group from scratch, the scaling group will not have scaling configurations after the scaling group is created. You must create a scaling configuration for the scaling group.
    Scaling Group Basic Information Scaling Group Name MyFirstScalingGroup None.
    Maximum Number of Instances 3 A maximum of three ECS instances can be created for the scaling group. Excessive ECS instances will be automatically removed from the scaling group.
    Minimum Number of Instances 1 The scaling group must contain at least one ECS instance. If the number of ECS instances in the scaling group is zero, an instance is automatically created for the scaling group.
    Tag ESS:Documentation Tags are used to categorize the scaling group for easy management.
    Scaling Configuration Network Type Classic network When you create a scaling configuration for the scaling group, you can select only instance types that support the classic network.
  5. Click Create.
  6. Click View Scaling Group Details.

Step 2. Create a scaling configuration and enable the scaling group

In this example, a scaling configuration is created with simple settings. For more information about the parameters, see Create a scaling configuration.

  1. In the left-side navigation pane, click Instance Configuration Source.
  2. Click Create Scaling Configuration.
  3. Configure the parameters for the scaling group.
    The following table describes the parameters used in this example. For parameters that are not described in the following table, use the default values.
    Configuration type Parameter Example Description
    Basic Configurations Billing Method Pay-as-you-go Auto Scaling is free of charge. However, you must pay for the ECS instances added to the scaling group based on the pricing of ECS. For more information, see Billing overview.
    Instance Type Shared balanced type: ecs.mn4.small Scaling groups in a VPC support more newly released instance types. For more information about how to create a scaling group in a VPC, see Create a scaling group.
    Image Public image: CentOS 7.6 64-bit After the instance is started, the operating system and application data of the image are copied to the system disk.
    Public IP Address Pay-by-traffic. A peak bandwidth of 1 Mbit/s You are charged for the outbound public traffic based on the traffic volume. The peak bandwidth is 1 Mbit/s.
    Security Group sg-bp18kz60mefsicfg**** Select the security group that you created in advance.
    System Configurations Logon Credentials Set Later You can manually set the password for ECS instances after the ECS instances are created.
    Create Scaling Configuration Name MyFirstScalingConfiguration None.
  4. Click Create.
  5. Click Enable Configuration.
  6. In the Apply Scaling Configuration message that appears, click Confirm.
  7. In the Enable Scaling Group message that appears, click Confirm.

Result

The minimum number of ECS instances in the scaling group is 1. Therefore, Auto Scaling automatically creates an ECS instance for the scaling group after it is enabled. You can view the ECS instance in the ECS instance list. The automatically created ECS instance applies configurations specified in the scaling configuration. For more information, see Query ECS instances.

What to do next

After the scaling group is enabled, you can create scaling rules for the scaling group and create scheduled tasks and event-triggered tasks to automatically scale ECS instances in the scaling group. For more information, see the following topics: