Deletes a scaling group. If you no longer need a scaling group, you can call the DeleteScalingGroup operation to delete it to free up the scaling group quota. If you delete a scaling group, the scaling configurations and scaling rules of the scaling group are deleted simultaneously.
Usage notes
Before you call the DeleteScalingGroup operation, take note of the following items:
If you delete a scaling group, the scaling configurations, scaling rules, scaling activities, and scaling requests related to the scaling group are also deleted.
If you delete a scaling group, the scheduled tasks and event-triggered tasks of the scaling group are not deleted. The load balancers and ApsaraDB RDS instances that are attached to the scaling group are also not deleted.
If you enabled the
Deletion Protection
feature when you created a scaling group, you cannot delete the scaling group in the Auto Scaling console or by using this operation. The Deletion Protection feature helps prevent accidental deletion of scaling groups.If you enabled the
Release Protection
feature when you created an Elastic Compute Service (ECS) instance and you want to delete the scaling group that manages the ECS instance, Auto Scaling forcibly removes the ECS instance from the scaling group and releases all automatically created ECS instances together with the scaling group after you call this operation.NotePrior to deleting a scaling group, make sure that your ECS instances within the scaling group are safeguarded against unintended release. Even if you have already enabled the Release Protection feature for the ECS instances, you must manually put these ECS instances into the Protected state. Doing so guarantees that the ECS instances will not be forcibly released during the deletion process of the scaling group, providing an extra layer of security. For more information, see SetInstancesProtection.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
Action | String | Yes | DeleteScalingGroup | The operation that you want to perform. Set the value to DeleteScalingGroup. |
ScalingGroupId | String | Yes | asg-bp18p2yfxow2dloq**** | The ID of the scaling group. |
ForceDelete | Boolean | No | false | Specifies whether to enforce the deletion of the scaling group, including the removal of all the existing ECS instances or elastic container instances from the scaling group and their subsequent release, even if the scaling group is actively undergoing scaling activities. Valid values:
Default value: false. |
RegionId | String | No | cn-qingdao | The region ID of the scaling group. |
Response parameters
Parameter | Type | Example | Description |
RequestId | String | 473469C7-AA6F-4DC5-B3DB-A3DC0DE3**** | The request ID. |
Examples
Sample requests
http(s)://ess.aliyuncs.com/?Action=DeleteScalingGroup
&ScalingGroupId=asg-bp18p2yfxow2dloq****
&ForceDelete=false
&RegionId=cn-qingdao
&<Common request parameters>
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<DeleteScalingGroupResponse>
<RequestId>473469C7-AA6F-4DC5-B3DB-A3DC0DE3****</RequestId>
</DeleteScalingGroupResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "473469C7-AA6F-4DC5-B3DB-A3DC0DE3****"
}
Error codes
For a list of error codes, see Service error codes.
HTTP status code | Error code | Error message | Description |
404 | InvalidScalingGroupId.NotFound | The specified scaling group does not exist. | The specified scaling group does not exist within your Alibaba Cloud account. |
403 | Forbidden.Unauthorized | A required authorization for the specified action is not supplied. | Auto Scaling is not authorized to call the operation. |
400 | InstanceInUse | You cannot delete a scaling configuration or scaling group while there is an instance associated with it. | The specified scaling group contains ECS instances or elastic container instances. |