Tags allow enterprises and individuals to identify and categorize their Elastic Compute Service (ECS) resources and simplify the search and management of the resources.

Use scenarios

You can use tags to manage, group, and categorize resources so that you can quickly search for and perform batch operations on the resources. Examples:

  • You can add different tags to different environments (such as production environments and test environments), operating systems (such as Windows Server and Linux), or client platforms (such as iOS and Android). For example, create the Test:Server-Windows tag and add this tag to all Windows ECS instances that are in a test environment. Then, you can find these instances based on the tag and perform batch operations on these instances. Example 2 of tag usage scenarios

    Examples of batch operations:

    • Replace images to deploy applications.
    • Upgrade patches.
    • Create security group rules to control network access.
    • Use Operation Orchestration Service (OOS) to batch start, stop, or restart ECS instances.
    • Use Cloud Assistant to run O&M scripts on multiple ECS instances.
  • If you manage teams or projects, you can add tags such as CostCenter:aliyun to groups, projects, or departments. Then, you can categorize the objects, and implement itemized billing and cross-authorization based on tags in the Billing Management console. Example of tag usage scenarios

    For more information, see the following topics:

Usage notes

  • Each tag consists of a key and a value.
  • Each tag key must be unique in a resource.

    For example, the city:shanghai tag is added to an instance. If the instance subsequently has the city:newyork tag added, the city:shanghai tag is automatically removed from the instance.

  • Tag information is not shared across regions. For example, tags that are created in the China (Hangzhou) region are invisible to the China (Shanghai) region.
  • After you remove a tag from a resource, the system automatically deletes the tag if the tag is not added to other resources.
  • For more information about tags, see Best practices for tag design.


For information about limits and quotas of tags, see the "Tag limits" section in Limits.

Services that support tags

The following table describes Alibaba Cloud services and resources that support tags.

Alibaba Cloud service Resource API operation
  • ECS instances
  • Reserved instances
  • Block storage devices
  • Snapshots
  • Automatic snapshot policies
  • Images
  • Security groups
  • Elastic Network Interfaces (ENIs)
  • Dedicated hosts
  • SSH key pairs
  • Launch templates
Auto scaling Scaling groups
Virtual Private Cloud (VPC)
  • VPCs
  • vSwitches
  • Route tables
  • Elastic IP addresses (EIPs)
ApsaraDB for Redis ApsaraDB for Redis instances
Alibaba Cloud Content Delivery Network (CDN) Domain names
Key Management Service (KMS) Customer master keys (CMKs)
PolarDB Clusters
Object Storage Service (OSS) Bucket Add, delete, modify, or query tags for a bucket: bucket-tagging
ApsaraDB RDS ApsaraDB RDS instances
AnalyticDB for PostgreSQL AnalyticDB for PostgreSQL instances Query resources based on tags: DescribeDBInstances
Cloud Enterprise Network (CEN) CEN instances
Smart Access Gateway (SAG) Cloud Connect Network (CCN) Query resources based on tags: DescribeCloudConnectNetworks
  • OOS templates
  • OOS operation tasks