All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::ESS::ScalingGroupEnable

Last Updated:Jun 10, 2026

ALIYUN::ESS::ScalingGroupEnable enables a scaling group.

Syntax

{
  "Type": "ALIYUN::ESS::ScalingGroupEnable",
  "Properties": {
    "ScalingConfigurationId": String,
    "ScalingRuleArisExecuteVersion": Integer,
    "ScalingRuleAris": List,
    "ScalingGroupId": String,
    "RemoveInstanceIds": List,
    "InstanceIds": List,
    "DetachOptions": Map,
    "AttachOptions": Map
  }
}

Properties

Property

Type

Required

Editable

Description

Constraint

ScalingGroupId

String

Yes

No

The ID of the scaling group.

None.

ScalingConfigurationId

String

No

No

The ID of the scaling configuration to activate in the scaling group.

None.

InstanceIds

List

No

Yes

The ECS instance IDs to add to the scaling group after it is enabled.

Maximum: 20 instance IDs.

ScalingRuleArisExecuteVersion

Integer

No

Yes

The execution version of the scaling rule identifier. Changing this value triggers a one-time execution of all scaling rules specified by ScalingRuleAris.

Minimum value: 0.

ScalingRuleAris

List

No

Yes

The unique identifiers of the scaling rules to execute. Inactive scaling rules are silently ignored.

Maximum: 10.

RemoveInstanceIds

List

No

Yes

The ECS instance IDs to remove from the scaling group.

Maximum: 1,000 instance IDs.

DetachOptions

Map

No

Yes

The options for removing instances from the scaling group.

DetachOptions properties

AttachOptions

Map

No

Yes

The options for adding instances to the scaling group.

AttachOptions properties

AttachOptions syntax

{
    "LifecycleHook": Boolean,
    "Entrusted": Boolean
}

AttachOptions properties

Property

Type

Required

Editable

Description

Constraint

LifecycleHook

Boolean

No

Yes

Whether to trigger a lifecycle hook during scale-out.

Default value: false. Valid values:

  • true

  • false

Entrusted

Boolean

No

Yes

Whether the scaling group manages the lifecycle of manually added instances.

Default value: false. Valid values:

  • true: The scaling group manages manually added instances and auto-created instances in the same manner.

    Instances removed via DetachInstances are not released. In other cases, instances are released upon removal.

  • false: The scaling group does not manage manually added instances. These instances are not released upon removal.

Note

Does not apply to subscription instances.

DetachOptions syntax

{
    "LifecycleHook": Boolean,
    "DecreaseDesiredCapacity": Boolean,
    "DetachOption": "String"
}

DetachOptions properties

Property

Type

Required

Editable

Description

Constraint

LifecycleHook

Boolean

No

Yes

Whether to trigger a lifecycle hook during scale-in.

Default value: false. Valid values:

  • true

  • false

DecreaseDesiredCapacity

Boolean

No

Yes

Whether to change the expected number of instances in the scaling group.

Default value: true. Valid values:

  • true: The desired capacity decreases when instances are removed.

  • false: The desired capacity remains unchanged when instances are removed.

DetachOption

String

No

Yes

Whether to remove instances from the associated SLB default server group and vServer groups, and remove their IP addresses from the associated ApsaraDB RDS whitelist.

Set to both to remove instances from the default server group and vServer groups of the associated SLB instance, and remove their IP addresses from the ApsaraDB RDS whitelist.

Return values

Fn::GetAtt

  • LifecycleState: the state of the scaling group.

  • ScalingInstances: the auto-created instances in the scaling group.

  • ScalingGroupId: the ID of the scaling group.

  • ScalingRuleArisExecuteResultInstancesRemoved: instances removed by executing the ScalingRuleAris scaling rules.

  • ScalingRuleArisExecuteResultNumberOfAddedInstances: the number of instances added by executing the ScalingRuleAris scaling rules.

  • ScalingInstanceDetails: details of instances involved in scaling activities.

  • ScalingRuleArisExecuteErrorInfo: error details from executing the ScalingRuleAris scaling rules.

  • ScalingRuleArisExecuteResultInstancesAdded: instances added by executing the ScalingRuleAris scaling rules.

Examples

  • YAML format

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters:
      ECSInstanceIds:
        Type: CommaDelimitedList
        AssociationProperty: ALIYUN::ECS::Instance::InstanceId
      AutoScalingGroupId:
        Type: String
        AssociationProperty: ALIYUN::ESS::AutoScalingGroup::AutoScalingGroupId
      ScalingConfigurationId:
        Type: String
        AssociationProperty: ALIYUN::ESS::ScalingConfiguration::ScalingConfigurationId
    Resources:
      ScalingGroupEnable:
        Type: ALIYUN::ESS::ScalingGroupEnable
        Properties:
          ScalingGroupId:
            Ref: AutoScalingGroupId
          ScalingConfigurationId:
            Ref: ScalingConfigurationId
          InstanceIds:
            Ref: InstanceIds
    Outputs:
      ScalingGroupEnable:
        Value:
          Fn::GetAtt:
            - ScalingGroupEnable
            - LifecycleState
                        
  • JSON format

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
        "ECSInstanceIds": {
          "Type": "CommaDelimitedList",
          "AssociationProperty": "ALIYUN::ECS::Instance::InstanceId"
        },
        "AutoScalingGroupId": {
          "Type": "String",
          "AssociationProperty": "ALIYUN::ESS::AutoScalingGroup::AutoScalingGroupId"
        },
        "ScalingConfigurationId": {
          "Type": "String",
          "AssociationProperty": "ALIYUN::ESS::ScalingConfiguration::ScalingConfigurationId"
        }
      },
      "Resources": {
        "ScalingGroupEnable": {
          "Type": "ALIYUN::ESS::ScalingGroupEnable",
          "Properties": {
            "ScalingGroupId": {
              "Ref": "AutoScalingGroupId"
            },
            "ScalingConfigurationId": {
              "Ref": "ScalingConfigurationId"
            },
            "InstanceIds": {
              "Ref": "InstanceIds"
            }
          }
        }
      },
      "Outputs": {
        "ScalingGroupEnable": {
          "Value": {
            "Fn::GetAtt": [
              "ScalingGroupEnable",
              "LifecycleState"
            ]
          }
        }
      }
    }