You can use tags to identify resources. Enterprises and individuals can use tags to group and categorize their ECS resources to simplify search and management.

Scenarios

Tags can be used to categorize and manage ECS resources. This improves search efficiency and allows 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 a tag named Test:Server-Windows and bind the tag to all the Windows ECS instances in the test environment. You can easily find these instances based on the tag and perform operations.Example 2 of tag usage scenarios

    You can perform the following batch operations on instances:

    • Change the image for application deployment.
    • Upgrade patches.
    • Add security group rules to control access.
    • Use Operation Orchestration Service (OOS) to start, stop, or restart multiple ECS instances at a time.
    • Run the O&M script on multiple ECS instances by using the Cloud Assistant.
  • 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:

Instructions

  • 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 Tags section in Limits.

Services that support tags

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

Service Supported resource API operation
Elastic Compute Service (ECS)
  • ECS instance
  • Block Storage
  • Snapshot
  • Image
  • Security group
  • Elastic Network Interface (ENI)
  • Dedicated host
  • SSH key pair
  • Instance launch template
Virtual Private Cloud (VPC)
  • VPC
  • VSwitch
  • Routing table
  • Elastic IP (EIP) Address
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 a tag: DescribeDBInstances
Cloud Enterprise Network (CEN) CEN instance
Smart Access Gateway (SAG) Cloud Connect Network (CCN) Query resources based on a tag: DescribeCloudConnectNetworks
Cloud Security Scanner Assets
Apsara File Storage Network Attached Storage (NAS) File system
Operation Orchestration Service (OOS)
  • OOS template
  • OOS operation tasks