All Products
Document Center

Elastic Compute Service:Best practices for tags

Last Updated:Jan 25, 2024

As the number of cloud resources increases, the difficulty in managing the resources also increases. For example, you may be unable to batch collect cost statistics about and perform O&M and monitoring on multiple cloud resources that serve the same purpose or belong to the same application category or organization to ensure that the resources are properly used and efficiently managed. To efficiently manage your resources, you can use tags to classify the resources. Tags are an important grouping tool that helps you in the horizontal management of personnel, finances, and materials and the fine-grained management of resources. Tags are suitable for various cloud resources and can meet your business requirements.


Tags are suitable for scenarios that involve resource management, access control, automated O&M, and cost allocation.


For information about other scenarios for which tags are suitable, see Overview of tags.

  • Management of application publishing procedures

  • Resource tracking and tag-based group search and management

  • Tag-based and group-based automated O&M by using Alibaba Cloud services such as CloudOps Orchestration Service, Resource Orchestration Service (ROS), Auto Scaling, and Cloud Assistant

  • Tag-based cost management and cost allocation

  • Resource-based or role-based access control

Best practices for tag design


You can implement the best practices for tag design based on the following principles:

  • Mutual exclusivity

    To implement mutual exclusivity, we recommend that you use only one tag key for an attribute. For example, if you use a tag key of owner to represent the owner attribute, you cannot use other tag keys, such as own and belonger, to represent the attribute.

  • Collective exhaustion

    Collective exhaustion means that when you plan resources, you must plan tags at the same time and prioritize tag keys. All resources must have tags that consist of the planned tag keys and the corresponding tag values.

    • Each tag key-value pair must be named in a standard format.

    • Collective exhaustion is a prerequisite for future tag-based access control, cost tracking, automated O&M, and group-based search.

  • Limited values

    Limited values mean that excess tag values must be removed and only core tag values are retained.

    You can simplify the procedures for resource management, access control, automated O&M, and cost allocation by following this principle. You can also use tags and automation tools based on this principle to manage resources. Elastic Compute Service (ECS) allows you to control tags by calling API operations to facilitate the automated management, search, and filtering of resources.

  • Considering ramifications of future changes

    When you plan tags based on the principle of limited values, you must consider the impacts of adding or removing tag values to improve the flexibility of modifying tags.

    If you modify tags, tag-based access control, automated O&M, or related billing reports may change. For corporate or personal business, the best practice is to create business-related tag groups to manage resources in the technical, business, and security dimensions. When you use automated O&M tools to manage resources and services, you can add automation-specific tags to facilitate automated O&M.

  • Simplified design

    Simplified design means that when you plan tags, you must create tag keys that have fixed dimensions to simplify the use the keys. By following this principle, you can reduce operation errors that are caused by redundant tag keys.

    • You can create business-related tag groups to manage resources in the technical, business, and security dimensions.

    • When you use automated O&M tools to manage resources and services, you can add automation-specific tags to the resources and services.

Examples of designing tags

The following table provides examples on how to name tags in common dimensions. We recommend that you use lowercase letters to name tags.


Tag key

Tag value


  • company

  • department

  • organization

  • team

  • group

Organization-specific names


  • product

  • business

  • module

  • service

Business-specific names


  • role

  • user

  • network administrator

  • application administrator

  • system administrator

  • opsuser

  • devuser

  • testuser


  • purpose

  • use

Specific purposes


  • From project dimensions:

    • project

    • risk

    • schedule

    • subtask

    • environment

  • From personnel dimensions:

    • sponsor

    • member

    • decisionmaker or owner

    • creator

Project-related values

Business department (to implement cost allocation and business tracking)

  • costcenter

  • businessunit

  • biz

  • financecontact

Department-related values

Owner from the finance dimension (to identify the resource owner)


Names or emails

Customer from the finance dimension (to identify the customers whom a specific resource group serves)

Custom or actual values

Customer names

Project from the finance dimension (to identify the projects that are supported by specific resources)


Project name

Order from the finance dimension


Order category IDs

Best practices for using tags

You can manage resources in a fine-grained manner based on tags. You can use tags for the following purposes or to perform the following operations.