Updated on 2024-11-15 GMT+08:00

Creating a Tag Policy

To standardize the usage of tags in your organization, you can create a tag policy to formulate tag rules.

You can create a tag policy from the organization administrator, but not from any delegated administrator.

Procedure

  1. Log in to the management console as the organization administrator or using the management account, and navigate to the Organizations console.
  2. Access the Policies page, and click Tag policies.

    Figure 1 Accessing the Tag policies page

  3. Click Create Policy.
  4. Edit the policy name. The policy name is automatically generated when you create a policy, but you can change the policy name if needed. Ensure that you are entering a unique policy name. It must be different from any other existing policy.

    (Optional) You can also enter a description for the policy.

  5. Edit the policy content. Currently, you can edit the policy content using the visual editor or JSON.

    • Visual editor: When you use the visual editor to edit a policy, you do not need to understand the JSON syntax. After you edit in the visual editor, the new policy is generated automatically. The procedure is as follows:
      1. Enter the key for the tag you want to define in the tag policy.
      2. Use the capitalization you specified above for the tag key.

        If you select this option, the capitalization you specified for Tag Key is used for checking compliance. If you do not select this option, tag keys in all lowercase characters are considered compliant even if Tag Key contains uppercase characters. For example, when you enter CostCenter for Tag Key, if you select this option, CostCenter will be the standard for compliance check; if you do not select this option, costcenter will be the standard.

      3. Specify allowed values for this tag key.

        If you select this option and click Specify Values to specify one or more allowed values for the tag key, only those values you specified are considered compliant. If you do not select this option or you select this option but do not specify any values, any value (including no value at all) is considered compliant.

        Figure 2 Specifying allowed values for this tag key
      4. Specify resource types to enforce the tag policy.

        Select the Prevent noncompliant operations on this tag. option and click Specify Resource Types. In the displayed dialog box, read and confirm the effects of using tag policies. Then, select resource types and click OK.

        If you do not specify any services or resource types, the tag policy will not apply to any resources.

        Figure 3 Specifying resource types
      5. Click Add Tag Key to add another tag key to this tag policy.
    • JSON: When using JSON syntax, you can edit the policy text by referring to Tag Policy Syntax. The system automatically verifies the syntax. If the syntax is incorrect, modify it as prompted.
      Figure 4 Editing a policy using JSON

  6. (Optional) Add one or more tags. Enter a tag key and a tag value, and click Add.

    Figure 5 Adding a tag

  7. Click Save in the lower right corner. If the tag policy is created successfully, it will be added to the list.