EnableScalingGroup
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 an instance configuration source (a scaling configuration, a launch template, or an ECS instance specified during the creation of the scaling group) is configured for the scaling group. Otherwise, the invoke failed.
NoteA scaling group has one and only one active instance configuration source at a time. When you invoke this operation, you can specify a scaling configuration or a launch template for the scaling group. If an instance configuration source is already configured for the scaling group before you invoke this operation, specifying a scaling configuration or a launch template during the invoke overwrites the original configuration.
-
If you specify the ECS instances to be added to the scaling group (InstanceId.N) when you invoke this operation, Auto Scaling checks whether the total number of ECS instances in the scaling group (Total Capacity) after the ECS instances are added is between the minimum number of instances (MinSize) and the maximum number of instances (MaxSize):
If the Total Capacity of the scaling group is less than MinSize, Auto Scaling performs automatic creation of the required number of pay-as-you-go ECS instances to make up the difference after the invoke succeeds.
For example, if you set MinSize to 5 when you create a scaling group and specify two existing ECS instances in the InstanceId.N parameter when you enable the scaling group, Auto Scaling adds the two existing ECS instances and then performs automatic creation of three ECS instances.
If the Total Capacity of the scaling group is greater than MaxSize, the invoke 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 enabled in the scaling group. |
asc-bp1ffogfdauy0nu5**** |
| LaunchTemplateId |
string |
No |
The ID of the launch template, which is used to specify that the scaling group obtains the 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 IDs of the ECS instances to be added 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 IDs of the ECS instances to be added 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 an ECS instance or elastic container instance (ECI) added to the scaling group as a backend server. Valid values of N: 1 to 20. Valid values of this parameter: 1 to 100. Default value: 50. |
50 |
|
integer |
No |
The weight of an ECS instance or elastic container instance (ECI) added to the scaling group as a backend server. 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 for the launch template. |
|
|
object |
No |
The override information for the launch template. |
||
| InstanceType |
string |
No |
When you need the scaling group to scale based on the instance type capacity, specify this parameter and LaunchTemplateOverride.N.WeightedCapacity at the same time. This parameter is used to specify the instance type and overrides the 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 is specified. Valid values of InstanceType: available ECS instance types. For more information, see Instance families. |
ecs.c5.xlarge |
| WeightedCapacity |
integer |
No |
When you need the scaling group to scale based on the instance type capacity, specify this parameter after you specify LaunchTemplateOverride.N.InstanceType. The two parameters correspond to each other one by one, and the value of N must be the same. This parameter is used to specify the weight of the instance type, which indicates the capacity that a single instance of the instance type represents in the scaling group. A greater weight indicates that fewer instances of this instance type are required to meet the expected capacity. Because performance metrics such as the number of vCPUs and memory size vary with each instance type, you can configure different weights for different instance types based on your business requirements. Example:
To meet the expected capacity, the scaling group scales out two ecs.c5.xlarge instances. Note
During a scale-out event, the capacity of the scaling group cannot exceed the sum of the maximum capacity (MaxSize) and the maximum weight of the instance type. 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.