Enables a scaling group.
Operation description
Operation description
-
You can invoke this operation to enable a scaling group only when the scaling group is in the Inactive state and has an instance configuration source (a scaling configuration, a launch template, or ECS instances specified during scaling group creation). Otherwise, the invocation fails.
NoteA scaling group can have only one active instance configuration source at a time. When you invoke this operation, you can specify a scaling configuration or launch template for the scaling group. If you have already configured an instance configuration source for the scaling group before invoking this operation, specifying a scaling configuration or launch template overwrites the existing configuration.
-
If you specify ECS instances (InstanceId.N) to add to the scaling group when invoking this operation, Auto Scaling checks whether the total number of ECS instances (Total Capacity) in the scaling group falls between the minimum value (MinSize) and the maximum value (MaxSize) after the ECS instances are added:
If the Total Capacity of the scaling group is less than MinSize, Auto Scaling performs automatic creation of pay-as-you-go ECS instances to make up the difference.
For example, if you set MinSize to 5 when creating the scaling group and specify 2 existing ECS instances in the InstanceId.N parameter when enabling the scaling group, Auto Scaling adds the 2 existing ECS instances and then performs automatic creation of 3 more ECS instances.
If the Total Capacity of the scaling group is greater than MaxSize, the invocation failed.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ess:EnableScalingGroup |
update |
*ScalingGroup
|
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 to be activated in the scaling group. |
asc-bp1ffogfdauy0nu5**** |
| LaunchTemplateId |
string |
No |
The ID of the launch template. This parameter specifies that the scaling group obtains launch configuration information from the launch template. |
lt-m5e3ofjr1zn1aw7**** |
| LaunchTemplateVersion |
string |
No |
The version of the launch template. Valid values:
|
Default |
| InstanceId |
array |
No |
The ID of the ECS instance to add to the scaling group after the scaling group is enabled. Valid values of N: 1 to 20. The ECS instances to be added to the scaling group must meet the following conditions:
|
i-283vv**** |
|
string |
No |
The ID of the ECS instance to add to the scaling group after the scaling group is enabled. Valid values of N: 1 to 20. The ECS instances to be added to the scaling group must meet the following conditions:
|
i-283vv**** |
|
| LoadBalancerWeight |
array |
No |
The weight of the ECS instance or elastic container instance as a backend server of the associated Server Load Balancer (SLB) instance. Valid values of N: 1 to 20. Valid values of this parameter: 1 to 100. Default value: 50. |
50 |
|
integer |
No |
The weight of the ECS instance or elastic container instance as a backend server of the associated SLB instance. Valid values of N: 1 to 20. Valid values of this parameter: 1 to 100. Default value: 50. |
50 |
|
| LaunchTemplateOverride |
array<object> |
No |
The override information of the launch template. |
|
|
object |
No |
The override information of the launch template. |
||
| InstanceType |
string |
No |
If you want the scaling group to scale based on the capacity of instance types, specify both this parameter and LaunchTemplateOverride.N.WeightedCapacity. This parameter specifies ECS instance type and overrides ECS instance type in the launch template. You can specify N values for this parameter to extend the launch template to support N instance types. Valid values of N: 1 to 10. Note
This parameter takes effect only when the LaunchTemplateId parameter specifies a launch template. For valid values of InstanceType, see Instance families. |
ecs.c5.xlarge |
| WeightedCapacity |
integer |
No |
If you want the scaling group to scale based on the capacity of instance types, specify this parameter after you specify LaunchTemplateOverride.N.InstanceType. The two parameters correspond to each other on a one-to-one basis, and the values of N must be the same. This parameter specifies the weight of the instance type, which represents the capacity of a single instance of this type in the scaling group. A higher weight means that fewer instances of this type are required to meet the expected capacity. Because instance types differ in the number of vCPUs, memory size, and other performance metrics, you can assign different weights to different instance types based on your requirements. For example:
To meet the expected capacity, the scaling group scales out by adding 2 ecs.c5.xlarge instances. Note
During a scale-out, the capacity of the scaling group cannot exceed the sum of the maximum capacity (MaxSize) and the maximum weight among the 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 request ID. |
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.