After you enable automatic tag remediation in a tag policy, the system automatically fixes non-compliant tags based on detection results.
Prerequisites
The Tag Policy feature is enabled. Enable the Tag Policy feature.
Overview
Automatic tag remediation works in both single-account mode and resource directory mode. This example uses a single-account tag policy with the cost center tag CostCenter:Beijing attached to the Alibaba Cloud account. The system remediates tags for resources that lack this tag or have non-compliant tag values.
Supported services are listed in the Support for automatic tag detection and automatic tag remediation column of Services that support tag policies.
Procedure
-
Log on to the Resource Management console.
-
Create a tag policy without selecting Automatic Remediation, then attach the policy to the current account to detect non-compliant resources.
In the tag policy, the tag key
CostCenterand the tag valueBeijingare specified. Perform automatic tag detection. -
View the resources whose tags are non-compliant.
The system detects resources that lack the
CostCenter:Beijingtag or have non-compliant tag values. You can view or download the results. View and download non-compliance detection results. -
Modify the tag policy to enable automatic tag remediation.
-
In the list of tag policies, find the policy that you want to modify and click Modify in the Actions column.
-
Select Automatic Remediation.
NoteIf an asterisk (
*) is specified for the tag value, automatic tag remediation cannot be enabled. -
Click Specify Scope for Automatic Remediation.
-
In the Specify Scope for Automatic Remediation dialog box, define the scope for automatic remediation, and then click Confirm.
-
Without Automatic Remediation (Default): Disables automatic remediation.
-
Specific Resource Scope: Remediates resources within a specific scope. You can define the scope by tag, region, resource group, resource type, or resource name regex.
-
All: Performs automatic remediation for all detected non-compliant resources. In this example, this option is selected.
NoteIn this example, all resources with the
CostCenter:Beijingtag are detected and remediated. To detect and remediate multiple tag values ofCostCenter, such asCostCenter:BeijingandCostCenter:Shanghai, specify multiple values in the Specify Allowed Tag Values field. You must define different scopes for different tag values. -
-
Click Submit.
-
-
Wait for automatic tag remediation to complete, then verify the results.
-
In the navigation pane on the left, choose .
-
Click the tag key of the target effective policy. On the policy details page, click the Remediation Records tab.
View remediation task details including resource information, results, and duration. Use filters to view successful or failed tasks.
-
Log on to the relevant Alibaba Cloud service console and verify that the remediated tags meet your requirements.
-
References
Use tag policies to implement automatic tagging based on resource names