Overview

Updated at:

Tags are key-value pairs you attach to keys and secrets in Key Management Service (KMS) instances. Use tags to organize resources, enforce access control, track costs, and support cross-team workflows.

Use cases

Resource management

Tags let you classify and group keys and secrets, which simplifies management at scale. For example:

  • Tag resources by project to view all resources belonging to a project at once.

  • Tag resources by environment (development, testing, production) to separate them clearly.

  • Tag resources by role or purpose (database key, file encryption key) to identify what each resource does.

To query all resources with a specific tag, go to the Tags page of the Resource Management console or call the API. For more information, see Use tags to query resources.

Access control

Use tags with Resource Access Management (RAM) to apply fine-grained permission management on keys and secrets. For example, restrict access to tagged keys to specific users or roles. This simplifies permission policy management and maintenance. For more information, see Manage key tags and secret tags.

Use tags for cost allocation

Plan tags for resources based on organizational or business dimensions (such as: region, department, environment, or project), then combine with the cost analysis provided by Alibaba Cloud, split billing features to implement cost allocation management. For more information, seeTag-based cost allocation overview.

Supported resources

Only resources in KMS instances support tags. Default keys do not support tags.

Resource Supports tags
Keys in KMS instances Yes
Default keys No
Secrets in KMS instances Yes

Limits and quotas

A tag consists of a tag key and a tag value. The tag key must be unique.

Common tag keys used by enterprise teams:

Key Example value
Project Alpha
Owner platform-team
Environment production
Application payment-service
Purpose database-encryption

Tag key limits:

  • Maximum length: 128 characters.

  • Allowed characters: letters, digits, spaces, and the following special characters: / \ _ - . + = : @

  • Cannot start with aliyun or acs:.

Tag value limits:

  • Maximum length: 128 characters.

  • Allowed characters: letters, digits, spaces, and the following special characters: / \ _ - . + = : @

Resource quota:

  • Up to 20 tags per resource.

For the full list of tag limits, see Tag overview.