Tag inheritance allows a resource to automatically inherit tags from an associated primary resource. This helps ensure tagging consistency and improves operational efficiency. For example, when you tag an Elastic Compute Service (ECS) instance, its associated disks, elastic network interfaces (ENIs), and elastic IP addresses (EIPs) can automatically inherit the same tags.
Background information
To manage tag inheritance, you must use your Alibaba Cloud account or a Resource Access Management (RAM) user that is attached the AliyunTagAdministratorAccess policy. For more information, see Create a RAM user and Grant permissions to a RAM user.
Limitations
For a list of supported resource types, see the "Supported resources" section in this topic.
You can specify a maximum of 50 tag keys to inherit in a single rule.
If an inherited tag has the same key as an existing tag on the associated resource, the inherited tag will overwrite the existing one. For example, if a primary resource has the tag
cost:shanghaiand its associated resource hascost:hangzhou, enabling inheritance for thecostkey will overwrite the associated resource's tag tocost:shanghai.For some resource types, you can enable the Apply to Existing Resources switch to apply tag inheritance to existing associated resources. For a list of supported resource types, see the Supports applying to existing resources column in the the "Supported resources" section of this topic.
Procedure
Enable the associated tag inheritance feature
Go to the Tag Inheritance of Associated Resources page.
Read the instructions, select the option to create a service-linked role, then click Enable and Configure Rules.
After you enable the feature, the system creates a service-linked role named AliyunServiceRoleForTag to manage tags on associated resources. For more information, see Service-linked role for Tag.

Enable a rule
On the Tag Inheritance of Associated Resources page, find the rule that you want to enable and click Enable Rule in the Actions column.

In the Enable Rule dialog box, configure the following parameters and click Enable.
For example, if you enable this rule for ENIs, an ENI will automatically inherit tags from an ECS instance when attached. The ENI's tags are then kept in sync with the instance's tags. When the ENI is detached, the inherited tags are automatically removed from it.

Applicable Scope: Specify which tag keys to inherit. You can choose to inherit all tag keys or a subset of them.
Apply to Existing Resources: If you enable this switch, the rule also applies to existing resources.
Modify a rule
On the Tag Inheritance of Associated Resources page, find the rule that you want to modify and click Modify Rule in the Actions column.

In the Modify Rule dialog box, modify the configuration and click Modify.
You can configure the Applicable Scope or enable or disable the Apply to Existing Resources switch.
Disable a rule
After you disable a tag inheritance rule, associated resources will no longer automatically inherit tags from their primary resources. This may affect resource management and cost allocation that rely on tags.
On the Tag Inheritance of Associated Resources page, find the rule that you want to disable and click Disable Rule in the Actions column.

In the Disable Rule dialog box, click Disable.
Manage rules in batches
On the Tag Inheritance of Associated Resources page, you can select multiple resource types and manage their rules in a batch.
At the bottom-left of the list, click Enable Rule to enable rules for the selected resource types.
At the bottom-left of the list, click Disable Rule to disable rules for the selected resource types.
At the bottom-left of the list, click Apply to Existing Resources to apply tag inheritance to existing associated resources for the selected resource types.
Disable the tag inheritance feature
After you disable the associated tag inheritance feature, the system no longer manages tags on associated resources. Existing tags on resources are not affected.
In the upper-right corner of the Tag Inheritance of Associated Resources page, click Disable.

In the message that appears, click Close.
Supported resources
Primary resource | Associated resource | Triggering condition | Supports applying to existing resources | Rule setting name (SettingName) |
ECS instance | Disks (including data disks and system disks) |
| Yes |
|
ENIs (including primary and secondary ENIs) |
| Yes |
| |
EIP |
| Yes | rule:AssociateEip-UnassociateEip-TagInstance:Ecs-Instance:Vpc-Eip | |
Disk | Snapshot |
| Yes |
|
ApsaraMQ for Kafka instance | Topic |
| Yes |
|
Consumer group |
| Yes |
| |
Container Service for Kubernetes (ACK) cluster | Security group | When you edit the tags of an ACK cluster, the tags of the security group are updated accordingly. | No |
|
ECS instance |
| No |
| |
Classic Load Balancer (CLB) instance | When you edit the tags of an ACK cluster, the tags of the CLB instance are updated accordingly. | No |
| |
EIP | When you edit the tags of an ACK cluster, the tags of the EIP are updated accordingly. | No |
| |
NAT gateway | When you edit the tags of an ACK cluster, the tags of the NAT gateway are updated accordingly. | No |
| |
Scaling group | When you edit the tags of an ACK cluster, the tags of the scaling group are updated accordingly. | No |
| |
CLB instance | EIP |
| Yes |
|
Network Load Balancer (NLB) instance | EIP |
| No |
|
Application Load Balancer (ALB) instance | EIP |
| No |
|
Virtual Private Cloud-Internet NAT gateway | EIP |
| Yes |
|
Elastic Container Instance (ECI)-Container group | EIP |
| No |
|
Supported regions
Indonesia (Jakarta), Malaysia (Kuala Lumpur), China (Hohhot), Singapore, Germany (Frankfurt), US (Virginia), US (Silicon Valley), China (Hong Kong), China (Qingdao), Japan (Tokyo), China (Zhangjiakou), China (Shenzhen), China (Beijing), China (Shanghai), China (Hangzhou), China (Chengdu), UK (London), China (Heyuan), China (Ulanqab), China (Guangzhou), Philippines (Manila), Thailand (Bangkok), China (Nanjing - Local Region) Closing Down, and China (Fuzhou - Local Region) Closing Down.