Tags can be used to identify resources. You can use tags to classify Message Queue for Apache RocketMQ resources. Tags can help you search for resources and aggregate resources. Message Queue for Apache RocketMQ allows you to add, modify, and remove tags for instances, topics, and groups. This topic describes the scenarios in which you can use tags, the instructions about how to use tags, limits of tags, and operations on tags.
When the created Message Queue for Apache RocketMQ resources increase, resource management becomes more difficult. You can use resource names to identify resources. You can also use tags to classify resources based on different dimensions such as business, purposes, and objects. After you attach tags to resources, you can quickly query and filter resources of a specified type by using tags.
- Each tag consists of a key-value pair.
- Each tag key must be unique in a resource.
For example, the
city:shanghaitag is attached to a Message Queue for Apache RocketMQ instance. Before you attach the
city:shenzhentag to the instance, delete the
- For more information about tags, see Best practices for tag design.
- Each tag key must be 1 to 64 Unicode characters in length. Each tag key is case-sensitive.
- Each tag value must be 1 to 64 Unicode characters in length. Each tag value is case-sensitive.
- A maximum of 20 tags can be attached to each resource.
- A tag key cannot start with aliyun or acs:, contain http:// or https://, or be an empty string.
- A tag value cannot contain http:// or https://. The tag value can be an empty string.
- Tags cannot be used across regions. For example, in the China (Shanghai) region, you cannot view the tags that are created in the China (Hangzhou) region.
Add a tag
- Log on to the Message Queue for Apache RocketMQ console.
- In the left-side navigation pane, click Instances.
- In the top navigation bar, select the region where your instance is deployed. For
example, you can select China (Hangzhou). On the Instances page, the instances that are deployed in this region are displayed.
- On the Instances page, find the instance to which you want to add a tag, move the pointer over the
icon in the Tags column, and then click Add.
- In the panel that appears, configure the Label Key and Label Value parameters. Then, click OK. If the icon in the Tags column changes to the icon, the tag is added.
Use a tag to filter resources
- On the Instances page, click Select Tag.
- Select a tag key from the Label Tag drop-down list, select a tag value from the Label
Value drop-down list, and then click Search. Only the instances with the specified tag are displayed in the list.
Modify or delete a tag
- On the Instances page, find the instance whose tags you want to manage, move the pointer over the
icon in the Tags column, and then click Edit.
- In the panel that appears, perform the following operations based on your business
- Modify a tag: Change the values of the Label Key and Label Value parameters or enter a new key-value pair in a new row, and then click OK.
- Delete a tag: Find the key-value pair that you want to delete and click the icon next to the pair. Then, click OK.