Creates and attaches tags. You can call the TagResources operation to uniformly create and attach tags to your Auto Scaling resources, streamlining resource management. This capability empowers you to categorize resources based on tags, thereby enhancing the overall efficiency of resource allocation and utilization.
Operation description
-
You can attach up to 20 tags to a scaling group.
**
Note Before you attach tags to a specific Auto Scaling resource, Alibaba Cloud automatically verifies the current number of tags attached to that resource. In the event the proposed addition would exceed the maximum allowed number of tags, an error message will be promptly returned after you call this operation.
-
If you set
Tags.Propagate
totrue
, any tags attached to your scaling group will be automatically propagated to new instances that are subsequently created in the scaling group, without affecting existing instances. -
If both the scaling configuration and the scaling group have tags attached, and tag propagation from the scaling group is enabled, the tags of newly created instances comply with the following rules:
- Instances set to join the scaling group will inherit the following tags: tags attached to the scaling configuration that initiates the instance creation and tags attached to the scaling group that are allowed to propagate to these instances upon instance creation.
- If the tag keys of the scaling configuration and those attached to the scaling group and propagated to the instances are identical, the tags attached to the scaling group and propagated to the instances will be overwritten by the tags of the scaling configuration.
Debugging
Authorization information
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
RegionId | string | Yes | The region ID of the resource. You can call the DescribeRegions operation to query the most recent region list. | cn-hangzhou |
ResourceType | string | Yes | The resource type. Set the value to scalinggroup. | scalinggroup |
ResourceIds | array | Yes | The IDs of the Auto Scaling resources. You can specify 1 to 50 resource IDs. | |
string | Yes | The ID of the Auto Scaling resource. | asg-2zej7nf7hea77k5a**** | |
Tags | object [] | Yes | Details of the tags. | |
Key | string | No | The key of the tag that you want to add to the Auto Scaling resource. You cannot specify empty strings as tag keys. The tag key must be 1 to 128 characters in length and cannot contain | TestKey |
Value | string | No | The value of the tag that you want to add to the Auto Scaling resource. You can specify empty strings as tag values. The tag value must be 0 to 128 characters in length and cannot contain | TestValue |
Propagate | boolean | No | Specifies whether to propagate the tag that you want to add. Valid values:
Default value: false. | false |
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "74C4E313-8570-479F-8791-DC25360D****"
}
Error codes
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|