ALIYUN::ESS::ScalingGroup is used to create a scaling group. A scaling group is a group of ECS instances that are dynamically scaled based on the configured scenario. A scaling group does not take effect immediately after being created. You must use ALIYUN::ESS::ScalingGroupEnable to enable the scaling group to trigger scaling rules and execute scaling activities.

Syntax

{
  "Type": "ALIYUN::ESS::ScalingGroup",
  "Properties": {
    "MultiAZPolicy": String,
    "DesiredCapacity": Integer,
    "NotificationConfigurations": List,
    "ProtectedInstances": List,
    "LaunchTemplateId": String,
    "LaunchTemplateVersion": String,
    "ScalingGroupName": String,
    "VSwitchIds": List,
    "DefaultCooldown": Integer,
    "MinSize": Integer,
    "GroupDeletionProtection": Boolean,
    "MaxSize": Integer,
    "InstanceId": String,
    "VSwitchId": String,
    "LoadBalancerIds": List,
    "StandbyInstances": List,
    "RemovalPolicys": List,
    "HealthCheckType": String,
    "DBInstanceIds": List
  }
}

Properties

Property Type Required Editable Description Constraint
MinSize Integer Yes Yes The minimum number of ECS instances in the scaling group.

Valid values: 0 to 1000.

When the number of ECS instances in the scaling group is less than the value of MinSize, Auto Scaling automatically creates ECS instances until the number of instances is equal to the value of MinSize.

MaxSize Integer Yes Yes The maximum number of ECS instances in the scaling group.

Valid values: 0 to 1000.

When the number of ECS instances in the scaling group is greater than the value of MaxSize, Auto Scaling removes the ECS instances from the scaling group until the number of instances is equal to the value of MaxSize.

ScalingGroupName String No Yes The display name of the scaling group.
  • The name must be 2 to 40 characters in length and can contain letters, digits, underscores (_), hyphens (-), and periods (.). It must start with a letter or digit.
  • The name must be unique to an Alibaba Cloud account in a region. The default value is the ID of the scaling group.
LaunchTemplateId String No Yes The ID of the instance launch template from which the scaling group obtains launch configurations. None
LaunchTemplateVersion String No Yes The version of the instance launch template. Valid values:
  • The fixed template version number.
  • Default: The default template version is always used.
  • Latest: The latest template version is always used.
RemovalPolicys List No Yes The policies to remove ECS instances from the scaling group. Default value: OldestScalingConfiguration or OldestInstance. Valid values:
  • OldestInstance: removes the ECS instance that is added to the scaling group at the earliest point in time.
  • NewestInstance: removes the ECS instance that is added to the scaling group at the latest point in time.
  • OldestScalingConfiguration: removes the ECS instance that is created based on the earliest scaling configuration.
VSwitchId String No No The ID of the VSwitch. None
LoadBalancerIds List No Yes The IDs of the SLB instances. This value can be a JSON array that contains up to five SLB instance IDs. Separate multiple IDs with commas (,).
DefaultCooldown Integer No Yes The cooldown period after a scaling activity (adding or removing ECS instances) is executed.
  • Valid values: 0 to 86400.
  • Unit: seconds.
  • Default value: 300.

During the cooldown period, the scaling group does not execute any other scaling activities triggered by CloudMonitor event-triggered tasks.

DBInstanceIds List No Yes The IDs of ApsaraDB for RDS instances. This value can be a JSON array that contains up to eight RDS instance IDs. Separate multiple IDs with commas (,).
VSwitchIds List No No The IDs of VSwitches. You can specify a maximum of five VSwitch IDs. If this parameter is specified, the VSwitchId parameter is ignored. VSwitches are sorted in descending order of priority. When an ECS instance cannot be created in the zone where the VSwitch with the highest priority resides, the system automatically uses the VSwitch with the next highest priority to create the ECS instance.
MultiAZPolicy String No No The ECS instance scaling policy for the multi-zone scaling group. Valid values:
  • PRIORITY: ECS instances are scaled based on the specified VSwitch. When an ECS instance cannot be created in the zone where the VSwitch with the highest priority resides, the system automatically uses the VSwitch with the next highest priority to create the ECS instance.
  • BALANCE: ECS instances are distributed evenly in multiple zones specified in the scaling group.
  • COST_OPTIMIZED: ECS instances are created based on the unit price of vCPUs, from low to high. Preemptible instances are created first when preemptible instance types are specified for the scaling configuration. Pay-as-you-go instances are created automatically when all types of preemptible instances are unavailable due to issues such as insufficient ECS resources.
NotificationConfigurations List No Yes The notification configurations for event and resource changes. None
ProtectedInstances List No Yes The number of protected ECS instances in the scaling group. Maximum value: 1000.
StandbyInstances List No Yes The number of ECS instances that are in the standby state in the scaling group. Maximum value: 1000.
HealthCheckType String No Yes The health check type. Valid values:
  • ECS
  • NONE
GroupDeletionProtection Boolean No Yes Specifies whether to enable deletion protection for the scaling group. Valid values:
  • true: enables deletion protection for the scaling group. In this case, you cannot delete the scaling group.
  • false: disables deletion protection for the scaling group. This is the default value.
DesiredCapacity Integer No Yes The expected number of ECS instances in the scaling group. The scaling group automatically keeps the number of ECS instances at the expected value. The number of ECS instances must be greater than the value of MinSize and be less than the value of MaxSize.
InstanceId String No No The ID of the ECS instance from which the scaling group obtains configuration information of the specified instance. None

Response parameters

Fn::GetAtt

ScalingGroupId: the ID of the scaling group. This ID is a globally unique identifier (GUID) generated by the system.

Examples

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Resources": {
    "ScalingGroup": {
      "Type": "ALIYUN::ESS::ScalingGroup",
      "Properties": {
        "MaxSize": 1,
        "MinSize": 1,
        # "ScalingGroupName": "HeatCreatedR****",
        # "DefaultCooldown": 500,
        # "RemovalPolicy_1": "",
        # "RemovalPolicy_2": "",
      }
    }
  },
  "Outputs": {
    "ScalingGroup": {
         "Value": {"Fn::GetAtt": ["ScalingGroup", "ScalingGroupId"]}
    }
  }
}