×
Community Blog Working with Tags in Alibaba Cloud Resource Management

Working with Tags in Alibaba Cloud Resource Management

In this blog, we are going to discuss how to create Tags using both Custom Tags and Predefined Tags option available in Alibaba Cloud Resource Management Service.

1. Introduction

Resource Management is a collection of all the associated resource management services used to provide easy management of the enterprise IT administration. The services for efficient resource management in Alibaba Cloud include Resource Directory, Resource Group, Resource Sharing, and Tag. Resource Directory is used to implement account management based on the organizational structure of the enterprise. Resource Group and Tag allow us to group and manage the resources within the accounts used by the enterprise. Resource Sharing lets the users that use the accounts in the same organizational structure to share resources with each other.

In this blog, we are going to discuss how to create Tags using both Custom Tags and Predefined Tags option available in Alibaba Cloud Resource Management Service. We will also discuss how to efficiently manage resources by using the Tag policy option of Alibaba Cloud Resource Management Service.

2. All about Tags

Tags can be used for identifying cloud resources created in our Alibaba Cloud account. Tags allow us to categorize, search for, and aggregate resources that have the same characteristics from different dimensions.

The Tag service allows us to perform the following operations:

  • Manage all tags in the same console of Resource Management.
  • Manage tags in a visualized manner.
  • Search for all tags and the resources to which tags are added on the Tag page of the Resource Management console.
  • Use a tag editor to add, modify, or query multiple tags at a time.

A tag consists of a tag key and a tag value. We can create tags, add them to resources, and then perform the following tasks:

  • Search for resources in a rapid manner.
  • Implement automated O&M.
  • Control access to resources.
  • Analyze data stored in Log Service in a rapid manner

3. Different Types of Tags

(i) Custom Tag

A custom tag is created by a user. If multiple cloud resources that are associated with each other exist within your account, we can add custom tags to these resources to categorize the resources. we can add up to 20 custom tags to a resource.

(ii) Predefined Tags

A predefined tag is the one created in advance and is added to the cloud resources in all regions. We can create predefined tags in the stage of tag planning and add them to specific cloud resources in the stage of tag implementation. The system provides some common built-in types for preset tags. The various Creation method available for Predefined tags are

  • Customize Predefined Tag
  • Select Tag Template
  • Import from Excel File

(iii) System Tag

A system tag is defined by the system . We can only query system tags. System tags present data relationships in a standard manner.

(iv) Createdby Tag

Createdby tags are a type of system tag that is generated by Alibaba Cloud and automatically added to resources. Createdby tags can help you identify the creators of resources, analyze expenses and bills at a low cost, and manage cloud resources and their costs in a convenient and efficient manner.

Overview of Tag Policies

Tag policies help us to standardize the tags that are used by the enterprise. We can use tag policies to define the tags that can be added to resources in the Alibaba Cloud account.Adding correct tags to resources improves management efficiency in scenarios such as cost allocation and automated O&M.

Features of Tag Policies:

(i) Automatic tag detection

After we create a resource and add tags to the resource, we can use a tag policy to periodically check the following items to determine the tag compliance of the resource:

(ii) Automatic remediation for tags

If we enable automatic remediation for tags and the remediation rules that you configure match the conditions for triggering automatic remediation, the system remediates the non-compliant tags based on the detection results.

(iii) Automatic tag inheritance from a resource group

After you add a tag to a resource group, if you create a resource in or add a resource to the resource group, the tag is automatically added to the resource.

(iv) Tag compliance enforcement

By default, tag compliance enforcement takes effect only for tags that are defined in a tag policy. If no tags are added to a resource to which the tag policy is applied or other tags are added to the resource, tag compliance enforcement does not take effect.

4. Steps in Creating and Working with Custom Tags

Step 1: In the Resource Management Console select "Tag" option and then click "Create Custom Tags" option available as showing below

1
Figure-1: Tag Creation Console

Step 2: Create new custom tag with "Tag key" and "Tag value" as shown below

2
Figure-2: Custom Tag Creation Console

Step 3: Now select the Services/Resources to which the tag has to be added and select the resource by using options "Select from Resource List" and "Enter Resource IDs"

3
Figure-3: Selecting Service and Resources for Tagging

Step 4: Now we can find the custom Tag created and the resource associated with the custom tag created in the "Tags" console.

4
Figure-4: Custom Tag List console

5
Figure-5: Resource associated with the custom tag created

5. Steps in Creating and working with Predefined Tags

Step 1: In the Resource Management Console select Tag and then click "Predefined Tags" option available as showing below

6
Figure-1: Predefined Tag Creation Console

Step 2: Select "Customize Predefined Tag" creation method and add Tag Key, Tag Value as shown below

7
Figure-2: Creating Tag using Customize Predefined Tag Method

Step 3: The Predefined Tag created using Customize Predefined Tag Method can be found in the Predefined Tag Console as shown below

8
Figure-3: Predefined Tag List created using Customize Predefined Tag Method

Step 4: Now you can view and add the resource added to the Tag using the options "View Resources" and "Add to Resources" option as shown below

9
Figure-4: "View Resources" and "Add to Resources" options in Predefined Tag

Step 5: Now select the Service to which the tag has to be added and select the resource by using options "Select from Resource List" and "Enter Resource IDs"

10
Figure-5: Selecting Service and Resources for Tagging

Step 6: Viewing the Resource allocated to the predefined tags by using the option "View Resources" in the Tag console as shown below

11
Figure-6: Viewing the resource Allocated using Predefined Tags

6. Steps in Creating and Assigning Tag Policy to the Resources

Step 1: In the Resource Management Console select "Policy Library" and then click "Create Tag Policy" option available as showing below

12
Figure-1: Policy Library Console

Step 2: In the "Create Tag Policy" console provide "Policy Name", "Policy Description" and "specify the policy detail" in quick mode or JSON as shown in the below diagram

13
Figure-2: Create Tag Policy Console

Step 3: In "Quick Mode" option provide Tag Key, Policy Scenario, allowed label values and Policy Execution Mode as shown in the below diagram

14
Figure-3: providing Tag Key, Policy Scenario, allowed label values and Policy Execution Mode in "Quick Mode"

Step 4: Enable following options such as "Specify the detected resource type for this tag key", "Enforcement", "Automatic Remediation" for the resource type "Virtual Private Cloud" as shown below

15
Figure-4: Enabling Quick Mode options

Step 4: Create the Tag Policy by clicking the "Create" option and select "Bind Account and Enable" as shown in the below diagram.

16
Figure-5: Policy creation and Enabling

Step 5: Now we can view the created tag policy in the "Policy Library" Console as Shown below

17
Figure-6: Policy Library Console with Created Tag Policy

Step 6: We can find the effective policy by using the option "Effective Policies" in the Tag Console

18
Figure-7: Effective Policies Console

Step 7: We can find the Non-compliant Resources associated with the Tag policy created using the option "Detection Results" in the Tag Console.

19
Figure-8: Detection Results Console

Step 8: Now the Non-compliant Resources associated with the Tag policy can be made to compliant Resources by using the Repair option as shown below

20
Figure-9: Repair option of Detection Results Console

Step 9: In the Repair Label option choose the corresponding tag created in the tag policy and click "ok"

21
Figure-10: Repair Label option of Detection Results Console

Step 10: Now in the "Detection Results" console we can find that the repaired resource is excluded from the "Non-compliant Resources" list as shown below

22
Figure-11: Detection Results Console after adding tag by repairing option

Wrapping it up

Using Alibaba Cloud Resource Management service options such as Resource Directory, Resource Group, Resource Sharing, and Tag we can efficiently manage the resources present in our Alibaba Cloud Account. In this blog discussed how to create Tags using both Custom Tags and Predefined Tags option available in Alibaba Cloud Resource Management Service and Finally we discussed how efficiently we can manage the resources using the Tag policy option of Alibaba Cloud Resource Management Service.

0 1 0
Share on

GAVASKAR S

11 posts | 3 followers

You may also like

Comments

GAVASKAR S

11 posts | 3 followers

Related Products

  • Resource Management

    Organize and manage your resources in a hierarchical manner by using resource directories, folders, accounts, and resource groups.

    Learn More
  • Cloud Shell

    A Web browser-based admin tool that allows you to use command line tools to manage Alibaba Cloud resources.

    Learn More
  • RAM(Resource Access Management)

    Secure your cloud resources with Resource Access Management to define fine-grained access permissions for users and groups

    Learn More
  • Cloud Config

    A configuration audit service that provides configuration history of enterprise resources in Alibaba Cloud and audits the compliance of resource configurations.

    Learn More