Creates and adds tags to resources.
Operation description
This topic provides an example of how to create and add a tag to a resource stack in China (Hangzhou) region. The resource stack ID is 7fee80e1-8c48-4c2f-8300-0f6dc40b****, with the tag key of FinanceDept and the tag value of FinanceJoshua.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ros:TagResources |
update |
*Stack
*StackGroup
Template
*TemplateScratch
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
Yes |
The region ID of the tag. You can call DescribeRegions to query the most recent region list. |
cn-hangzhou |
| ResourceType |
string |
Yes |
The resource type. Valid values:
|
stack |
| ResourceId |
array |
Yes |
The resource IDs. |
7fee80e1-8c48-4c2f-8300-0f6dc40b**** |
|
string |
No |
The resource ID. You can specify up to 50 resource IDs. Note
When the value of ResourceType is stackgroup, specify the name of the stack group. |
7fee80e1-8c48-4c2f-8300-0f6dc40b**** |
|
| Tag |
array<object> |
Yes |
The tags of the resources. You can specify up to 20 tags. |
|
|
object |
No |
The tag of the resource. |
||
| Key |
string |
Yes |
The key of the tag to add to the resource. You can specify up to 20 tag keys. The length must not exceed 128 characters. It cannot start with |
FinanceDept |
| Value |
string |
Yes |
The value of the tag to add to the resource. You can specify up to 20 tag values. The length must not exceed 128 characters. It cannot start with |
FinanceJoshua |
For more information about common request parameters, refer to Common parameters.
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
The request ID. |
C46FF5A8-C5F0-4024-8262-B16B639225A0 |
Examples
Success response
JSON format
{
"RequestId": "C46FF5A8-C5F0-4024-8262-B16B639225A0"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.