Tag inheritance
Tag inheritance automatically propagates tags from a primary resource to its associated resources when you modify tags or create an association, improving O&M efficiency. For example, when you add a tag to an ECS instance, its associated disks, elastic network interfaces, and elastic IP addresses automatically inherit the tag. Newly associated resources also inherit the tag.
Background information
You can manage tag inheritance by using your Alibaba Cloud account or a RAM user with the AliyunTagAdministratorAccess permission. For more information, see Create a RAM user and Manage RAM user permissions.
Limits
-
For supported resource types, see Resources that support tag inheritance.
-
When configuring a rule to inherit only specific tags, you can specify up to 50 tag keys.
-
If an inherited tag has the same key as an existing tag on an associated resource, the inherited tag overwrites the existing one. For example, if an associated resource has the tag
cost:hangzhouand the primary resource has the tagcost:shanghai, configuring a rule to inherit thecostkey overwritescost:hangzhouwithcost:shanghai. -
For some resource types, you can apply tag inheritance to existing associated resources by turning on the Apply to Existing Resources switch. For supported resource types, see the Supports applying to existing resources column in Resources that support tag inheritance.
Operations
Enable tag inheritance
-
Go to the Tag inheritance page.
-
Read the instructions, select the checkbox to create a service-linked role, and then click Enable and Configure Rules.
After you enable this feature, a service-linked role named AliyunServiceRoleForTag is created to manage tags on associated resources. For more information, see Service-linked role for Tag.
Enable a rule
-
On the Tag inheritance page, find the target resource type and click Enable Rule in the Actions column.
-
In the Enable Rule dialog box, configure the rule and click Enable.
Example: After you enable the rule, an elastic network interface inherits the tags of the ECS instance it is attached to and stays in sync. When detached, the inherited tags are automatically removed.
-
Applicable Scope: Specify the tag keys to inherit. You can inherit all tag keys or only specific ones.
-
Apply to Existing Resources: If you turn on this switch, the rule also applies to existing resources.
-
Modify a rule
-
On the Tag inheritance page, find the target resource type and click Modify Rule in the Actions column.
-
In the Modify Rule dialog box, modify the rule and click Modify.
You can modify the Applicable Scope and enable or disable the Apply to Existing Resources switch.
Disable a rule
After you disable a tag inheritance rule, associated resources no longer automatically inherit tags from their primary resources. This may affect tag-based operations, such as resource management and cost allocation.
-
On the Tag inheritance page, find the target resource type and click Disable Rule in the Actions column.
-
In the Disable Rule dialog box, click Disable.
Manage rules in bulk
On the Tag inheritance page, select multiple resource types to manage their rules in bulk.
-
In the lower-left corner of the list, click Enable Rule to enable multiple rules at a time.
-
In the lower-left corner of the list, click Disable Rule to disable multiple rules at a time.
-
In the lower-left corner of the list, click Apply to Existing Resources to apply tag inheritance to existing associated resources in bulk.
Disable tag inheritance
After you disable the tag inheritance feature, the system no longer performs tag operations on associated resources. Existing tags on resources are not affected.
-
In the upper-right corner of the Tag inheritance page, click Disable.
-
In the confirmation dialog box, click Close.
Resources that support tag inheritance
|
Primary resource |
Associated resource |
Triggering condition |
Supports existing resources |
Rule name (SettingName) |
|
ECS instance |
disk (including data disk and system disk) |
|
Yes |
|
|
elastic network interface (including primary and secondary ENIs) |
|
Yes |
|
|
|
elastic IP address |
|
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 |
The security group's tags stay in sync with the cluster's tags. |
No |
|
|
ECS instance |
|
No |
|
|
|
Classic Load Balancer (CLB) instance |
The CLB instance's tags stay in sync with the cluster's tags. |
No |
|
|
|
elastic IP address |
The elastic IP address's tags stay in sync with the cluster's tags. |
No |
|
|
|
NAT gateway |
The NAT gateway's tags stay in sync with the cluster's tags. |
No |
|
|
|
scaling group |
The scaling group's tags stay in sync with the cluster's tags. |
No |
|
|
|
Classic Load Balancer (CLB) instance |
elastic IP address |
|
Yes |
|
|
Network Load Balancer (NLB) instance |
elastic IP address |
|
No |
|
|
Application Load Balancer (ALB) instance |
elastic IP address |
|
No |
|
|
Virtual Private Cloud (VPC) NAT gateway |
elastic IP address |
|
Yes |
|
|
Elastic Container Instance (ECI) container group |
elastic IP address |
|
No |
|
Supported regions
China (Beijing), China (Chengdu), China (Fuzhou - Local Region) (Discontinued), China (Guangzhou), China (Hangzhou), China (Heyuan), China (Hohhot), China (Hong Kong), China (Nanjing - Local Region) (Discontinued), China (Qingdao), China (Shanghai), China (Shenzhen), China (Ulanqab), China (Zhangjiakou), Germany (Frankfurt), Indonesia (Jakarta), Japan (Tokyo), Malaysia (Kuala Lumpur), Philippines (Manila), Singapore, Thailand (Bangkok), UK (London), US (Silicon Valley), and US (Virginia).