All Products
Search
Document Center

Resource Management:Tag inheritance of associated resources

Last Updated:Apr 14, 2025

Resource Management provides the tag inheritance feature for associated resources. When you manage the tags of a primary resource or establish relationships between the primary resource and other resources, this feature enables the associated resources of the primary resource to automatically inherit the tag changes that are made to the primary resource. This improves O&M efficiency and reduces tag management costs. For example, when you add a tag to or remove a tag from an Elastic Compute Service (ECS) instance, the tag is automatically added to or removed from the cloud disks, elastic network interface (ENI), and elastic IP address (EIP) of the ECS instance. When you attach a cloud disk to the ECS instance, bind an ENI to the ECS instance, or associate an EIP with the ECS instance, the cloud disk, ENI, or EIP automatically inherits the tags of the ECS instance.

Limits

  • For information about the resource types that support the tag inheritance feature, see Resource types that support the tag inheritance feature.

  • If you select "Specific Tag Keys" for a type of resource when you configure a tag inheritance rule, you can specify a maximum of 50 tag keys.

  • After you enable the tag inheritance feature and configure a tag inheritance rule for a type of resource, the existing tag of a resource of this type is overwritten if the key of the tag that you specify is the same as the key of the existing tag. For example, cost:hangzhou is an existing tag of an associated resource, and cost:shanghai is added to the primary resource of the associated resource. If you select "Specific Tag Keys" for the associated resource and specify the tag key cost when you configure a tag inheritance rule, the existing tag cost:hangzhou of the associated resource is overwritten by cost:shanghai.

  • The tag inheritance feature cannot enable an existing associated resource to inherit the existing tags of the primary resource. If you want to allow an existing associated resource, such as a cloud disk, a snapshot, or an EIP, to inherit the existing tags of the primary resource before you enable the feature, you can use a public template provided by CloudOps Orchestration Service (OOS). For more information, see Use OOS to inherit tags from ECS instances for the resources of the ECS instances at a time.

Basic operations

Enable the tag inheritance feature and configure a tag inheritance rule

  1. Log on to the Resource Management console.

  2. In the left-side navigation pane, choose Tag > Tag Inheritance of Associated Resources.

  3. Read the instructions, select the check box for creating a service-linked role, and then click Enable and Configure Rules.

    When you enable the tag inheritance feature, the system creates the AliyunServiceRoleForTag service-linked role. The role is used to perform tag-related operations on associated resources. For more information, see Service-linked role for Tag.

    image

  4. Configure tag inheritance rules for associated resources and click OK.

    You can set the tag inheritance scope for different types of associated resources to All Tag Keys or Specific Tag Keys.

    image

Modify a tag inheritance rule

  1. Log on to the Resource Management console.

  2. In the left-side navigation pane, choose Tag > Tag Inheritance of Associated Resources.

  3. In the upper-right corner of the page that appears, click Edit to modify a tag inheritance rule.

  4. Click OK.

Disable the tag inheritance feature

Important

After you disable the tag inheritance feature, the system no longer performs tag-related operations on associated resources. Tags that are inherited by existing associated resources are not affected.

  1. Log on to the Resource Management console.

  2. In the left-side navigation pane, choose Tag > Tag Inheritance of Associated Resources.

  3. In the upper-right corner of the page that appears, click Disable.

    image

  4. In the message that appears, click OK.

Resource types that support the tag inheritance feature

Primary resource type

Associated resource type

Description

Rule name

ECS instance

Cloud disk (including data disks and system disks)

  • If you attach a cloud disk to an ECS instance, the cloud disk automatically inherits the existing tags of the ECS instance and also inherits the tag changes that are made to the ECS instance later.

  • If you detach a cloud disk from an ECS instance, the system removes the tags that are automatically inherited from the ECS instance for the cloud disk.

rule:AttachDisk-DetachDisk-TagInstance:Ecs-Instance:Ecs-Disk

ENI (including primary ENIs and secondary ENIs)

  • If you bind an ENI to an ECS instance, the ENI automatically inherits the existing tags of the ECS instance and also inherits the tag changes that are made to the ECS instance later.

  • If you unbind an ENI from an ECS instance, the system removes the tags that are automatically inherited from the ECS instance for the ENI.

rule:AttachEni-DetachEni-TagInstance:Ecs-Instance:Ecs-Eni

EIP

  • If you associate an EIP with an ECS instance, the EIP automatically inherits the existing tags of the ECS instance and also inherits the tag changes that are made to the ECS instance later.

  • If you disassociate an EIP from an ECS instance, the system removes the tags that are automatically inherited from the ECS instance for the EIP.

rule:AssociateEip-UnassociateEip-TagInstance:Ecs-Instance:Vpc-Eip

Cloud disk

Snapshot

  • If you create a snapshot for a cloud disk, the snapshot automatically inherits the existing tags of the cloud disk.

  • If you modify the existing tags of the cloud disk, the snapshot automatically inherits the tag changes that are made to the cloud disk.

rule:CreateSnapshot-TagDisk:Ecs-Disk:Ecs-Snapshot

ApsaraMQ for Kafka instance

Topic

  • If you create a topic based on an ApsaraMQ for Kafka instance, the topic automatically inherits the existing tags of the instance.

  • If you modify the existing tags of the ApsaraMQ for Kafka instance, the topic automatically inherits the tag changes that are made to the instance.

rule:CreateTopic-TagKafka:Kafka-Instance:Kafka-Topic

Consumer group

  • If you create a consumer group based on an ApsaraMQ for Kafka instance, the consumer group automatically inherits the existing tags of the ApsaraMQ for Kafka instance.

  • If you modify the existing tags of the ApsaraMQ for Kafka instance, the consumer group automatically inherits the tag changes that are made to the instance.

rule:CreateConsumerGroup-TagKafka:Kafka-Instance:Kafka-ConsumerGroup

Container Service for Kubernetes (ACK) cluster

Security group

If you modify the existing tags of an ACK cluster, the related security group automatically inherits the tag changes that are made to the cluster.

rule:TagCluster:Cs-Cluster:Ecs-SecurityGroup

ECS instance

  • If you expand an ACK managed cluster, the related ECS instance automatically inherits the existing tags of the cluster.

  • If you modify the existing tags of the ACK cluster, the related ECS instance automatically inherits the tag changes that are made to the cluster.

rule:CreateInstance-TagCluster:Cs-Cluster:Ecs-Instance

Server Load Balancer (SLB) instance

If you modify the existing tags of an ACK cluster, the related SLB instance automatically inherits the tag changes that are made to the cluster.

rule:TagCluster:Cs-Cluster:Slb-Instance

EIP

If you modify the existing tags of an ACK cluster, the EIP of the ACK cluster automatically inherits the tag changes that are made to the cluster.

rule:TagCluster:Cs-Cluster:Vpc-Eip

NAT gateway

If you modify the existing tags of an ACK cluster, the related NAT gateway automatically inherits the tag changes that are made to the cluster.

rule:TagCluster:Cs-Cluster:Vpc-Natgateway

Scaling group

If you modify the existing tags of an ACK cluster, the related scaling group automatically inherits the tag changes that are made to the cluster.

rule:TagCluster:Cs-Cluster:Ess-ScalingGroup

Regions in which the tag inheritance feature is available

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), and China (Fuzhou - Local Region).