Tags can be used to identify resources. Tags allow enterprises and individuals to categorize their ECS resources and simplify the search and management of resources.

Scenarios

Tags can make your search more efficient and allow you to perform batch operations on resources. For example:

  • You can bind different tags to environments such as production and test environments, operating systems such as Windows and Linux, and mobile platforms such as iOS and Android. For example, create the Test:Server-Windows tag and bind this tag to all the Windows ECS instances that are in the test environment. 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 the image to deploy applications.
    • Upgrade patches.
    • Create security group rules to control access.
    • Use Operation Orchestration Service (OOS) to batch start, stop, or restart ECS instances.
    • Use Cloud Assistant to run an O&M script on multiple ECS instances.
  • In team or project management, 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 on the Billing Management page of the ECS console.Example of tag usage scenarios

    For more information, see the following topics:

Precautions

  • Each tag consists of a key-value pair.
  • A tag must have a unique tag key.

    For example, an ECS instance is bound to the city:shanghai tag. If the instance is subsequently bound to the city:newyork tag, the city:shanghai tag is automatically unbound from the instance.

  • Tag information is not shared across regions. For example, tags created in the China (Hangzhou) region are not visible to the China (Shanghai) region.
  • Tags are deleted when they are not bound to any resources.
  • For more information about the best practices for tag design, see Best practices for tag design.

Limits

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

Services that support tags

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

Service Resource API operation
Elastic Compute Service (ECS)
  • ECS instance
  • Reserved instance
  • Elastic Block Storage (EBS)
  • Snapshot
  • Automatic snapshot policy
  • Image
  • Security group
  • Elastic network interface (ENI)
  • Dedicated host
  • SSH key pair
  • Launch template
Auto Scaling Scaling group
Virtual Private Cloud (VPC)
  • VPC
  • VSwitch
  • Route table
  • Elastic IP address (EIP)
ApsaraDB for Redis ApsaraDB for Redis instance
Alibaba Cloud Content Delivery Network (CDN) Domain name
Key Management Service (KMS) Customer master key (CMK)
Apsara PolarDB Cluster
Object Storage Service (OSS) Bucket Add, delete, modify, or query tags for a bucket: bucket-tagging
ApsaraDB for RDS ApsaraDB for RDS instance
AnalyticDB for PostgreSQL AnalyticDB for PostgreSQL instance Query resources based on tags: DescribeDBInstances
Cloud Enterprise Network (CEN) CEN instance
Smart Access Gateway (SAG) Cloud Connect Network (CCN) Query resources based on tags: DescribeCloudConnectNetworks
Cloud Security Scanner Assets
Apsara File Storage NAS File system
Operation Orchestration Service (OOS)
  • OOS template
  • OOS operation tasks