Auto Scaling executes a scaling rule to add or remove ECS instances by using scheduled tasks. This topic describes how to automatically add ECS instances to a scaling group. Two ECS instances will be added to a scaling group in this topic.

Background information

The MyFirstScalingGroup scaling group and MyFirstScalingConfiguration scaling configuration are used in this topic to demonstrate how to automatically add ECS instances. The scaling group already contains one ECS instance.

Step 1: Create a scaling rule

  1. Log on to the Auto Scaling console.
  2. In the left-side navigation pane, click Scaling Groups.
  3. Find the target scaling group and use one of the following methods to open the details page of the scaling group:
    • Click the ID of the scaling group in the Scaling Group Name/ID column.
    • Click Manage in the Actions column.
  4. In the left-side navigation pane, click Scaling Rules.
  5. In the upper-right corner of the Scaling Rules page, click Create Scaling Rule.
  6. Set parameters for the scaling rule and click Create Scaling Rule.
    The following table describes the parameters used in this example. For parameters that are not described in the following table, use the default values.
    Parameter Example
    Name Add2
    Rule Type Simple Scaling Rule
    Operation Add 2 Instances
  7. In the upper-left corner of the Scaling Rules page, click the Back icon to go back to the Scaling Groups page.

Step 2: Create a scheduled task

  1. In the left-side navigation pane, choose Scaling Tasks > Scheduled Tasks.
  2. In the upper-right corner of the Scheduled Tasks page, click Create Scheduled Task.
  3. Set parameters for the scheduled task and click OK.
    The following table describes the parameters used in this example. For parameters that are not described in the following table, use the default values.
    Parameter Example Description
    Task Name ScheduledScalingOut None.
    Description Add two ECS instances at the scheduled time. None.
    Run At 2019-11-11 16:35 Five minutes after the current time.
    Scaling Group MyFirstScalingGroup Executes the scheduled task for the MyFirstScalingGroup scaling group.
    Scaling Method Select an existing rule None.
    Scaling Rules (Simple Scaling Rule) Add2 Executes the Add2 scaling rule and adds two ECS instances to the scaling group.

Result

At 16:35 on November 11, 2019, the ScheduledScalingOut scheduled task automatically executes the Add2 scaling rule to add two ECS instances to the MyFirstScalingGroup scaling group. For more information, see the Scaling Activities page.