After you enable the automatic tag remediation feature of a tag policy, the system remediates non-compliant tags for resources to which the tag policy is applied based on the detection results.
Prerequisites
The Tag Policy feature is enabled. For more information, see Enable the Tag Policy feature.
Background information
The automatic tag remediation feature is available when you use the Tag Policy feature in single-account mode or resource directory mode. This topic describes how to enable automatic tag remediation for resources within an Alibaba Cloud account. In this example, a tag policy in single-account mode is used, the cost center tag CostCenter:Beijing
is defined in the tag policy, and the tag policy is attached to the Alibaba Cloud account. If the cost center tag is not added to the resources or tags that are added to the resources are non-compliant, the system remediates tags for the resources.
For information about the Alibaba Cloud services that support automatic tag remediation, see the Support for automatic tag detection and automatic tag remediation column in Services that support tag policies.
Procedure
Log on to the Resource Management console.
Create a tag policy for which Automatic Remediation is not selected. Then, attach the tag policy to the logon account to enable the system to only detect resources whose tags are non-compliant within the account.
In the tag policy, the tag key
CostCenter
and the tag valueBeijing
are specified. For more information, see Perform automatic tag detection.View the resources whose tags are non-compliant.
The system detects the resources to which the
CostCenter:Beijing
tag is not added or to which tags other than CostCenter:Beijing are added based on the tag policy. You can view or download the detection results for non-compliant tags. For more information, see View and download non-compliance detection results.Modify the configuration of the tag policy to enable automatic tag remediation for the tag policy.
On the Policy Library page, find the tag policy and click Modify in the Actions column.
On the page that appears, select Automatic Remediation.
Click Specify Scope for Automatic Remediation.
In the Specify Scope for Automatic Remediation dialog box, configure settings for automatic tag remediation and click OK.
Not Auto Repair: If you select this option, the system does not remediate non-compliant tags for the resources within the account. This is the default option.
Specify Scope: If you select this option and specify other tags, the system remediates non-compliant tags for resources to which the specified tags are added. For example, if you specify the tag key
user
and the tag valuetest
, the system remediates non-compliant tags for the resources to which theuser:test
tag is added.All: If you select this option, the system remediates non-compliant tags for all resources in the detection results. In this example, All is selected.
Click OK.
Wait until automatic tag remediation is complete and check whether the remediation results meet your business requirements.
In the left-side navigation pane, choose .
On the Add Tags with Specified Tag Values to Resources tab, view the remediation tasks.
You can view information such as the details of a resource on which a remediation task is run, the remediation result, and the time consumed for the remediation. In addition, you can specify filter conditions to view the remediation tasks that are successfully run or fail to run.
Log on to the console of the Alibaba Cloud service to which one of the resources belongs and check whether tags added to the resource meet your business requirements.