All Products
Search
Document Center

Auto Scaling:EnableScalingGroup

Last Updated:Aug 27, 2026

Enables a scaling group that is in the Disabled state and has an instance configuration source, such as a launch template or scaling configuration. After the scaling group is enabled, Auto Scaling dynamically adjusts the number of instances based on your business requirements.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

ess:EnableScalingGroup

update

*ScalingGroup

acs:ess:{#regionId}:{#accountId}:scalinggroup/{#ScalingGroupId}

None None

Request parameters

Parameter

Type

Required

Description

Example

ScalingGroupId

string

Yes

The ID of the scaling group.

asg-bp14wlu85wrpchm0****

ActiveScalingConfigurationId

string

No

The ID of the scaling configuration that you want to enable in the scaling group.

asc-bp1ffogfdauy0nu5****

LaunchTemplateId

string

No

The ID of the launch template used to create ECS instances.

lt-m5e3ofjr1zn1aw7****

LaunchTemplateVersion

string

No

The version number of the launch template. Valid values:

  • A fixed template version number.

  • Default: The default template version is always used.

  • Latest: The latest template version is always used.

Default

InstanceIds

array

No

The IDs of the ECS instances that you want to add to the scaling group after the scaling group is enabled.

Before you add ECS instances to the scaling group, make sure that the instances meet the following requirements:

  • The instances must reside in the same region as the scaling group.

  • The instances must be in the Running state.

  • The instances do not belong to another scaling group.

  • The instances are billed on a subscription or pay-as-you-go basis, or the instances are preemptible instances.

  • If you specify VswitchID for the scaling group, the instances must share the same VPC as the scaling group.

  • If you do not specify VswitchID for the scaling group, the instances must use the classic network.

string

No

The ID of the ECS instance that you want to add to the scaling group after the scaling group is enabled.

Before you add an ECS instance to the scaling group, make sure that the instance meets the following requirements:

  • The instance must reside in the same region as the specified scaling group.

  • The instance must be in the Running state.

  • The instance does not belong to another scaling group.

  • The instance is billed on a subscription or pay-as-you-go basis, or the instance is a preemptible instance.

  • If you specify VswitchID for the scaling group, the instance must share the same VPC as the scaling group.

  • If you do not specify VswitchID for the scaling group, the instance must use the classic network.

i-283vv****

LoadBalancerWeights

array

No

The weights of ECS instances or elastic container instances as backend servers.

Default value: 50.

integer

No

The weight of an ECS instance or elastic container instance as a backend server.

Default value: 50.

50

LaunchTemplateOverrides

array<object>

No

The instance types to extend in the launch template.

object

No

Details of the instance types specified in the extended launch template configurations.

InstanceType

string

No

The instance type. To scale instances based on instance type weights, you must also specify LaunchTemplateOverrides.WeightedCapacity.

This parameter overwrites the instance type specified in the launch template.

Note

This parameter takes effect only if you specify LaunchTemplateId.

You can use this parameter to specify any instance type available for purchase.

ecs.c5.xlarge

WeightedCapacity

integer

No

The weight of the instance type. To scale instances based on instance type weights, specify this parameter together with LaunchTemplateOverrides.InstanceType.

The weight represents the capacity of a single instance of the specified type in the scaling group. A higher weight means fewer instances are needed to meet the expected capacity.

Because performance metrics such as vCPUs and memory vary by instance type, you can assign different weights to match your business requirements.

Example:

  • Current capacity: 0

  • Expected capacity: 6

  • Capacity of ecs.c5.xlarge: 4

To reach the expected capacity, Auto Scaling must scale out two instances of ecs.c5.xlarge.

Note

The scaling group capacity cannot exceed the sum of MaxSize and the maximum weight among all instance types.

Valid values of WeightedCapacity: 1 to 500.

4

RegionId

string

No

The region ID of the scaling group.

cn-qingdao

Response elements

Element

Type

Description

Example

object

RequestId

string

The ID of the request.

473469C7-AA6F-4DC5-B3DB-A3DC0DE3****

Examples

Success response

JSON format

{
  "RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3****"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.