If you specify a tag for a stack when you create or update the stack by calling an API operation, Resource Orchestration Service (ROS) propagates the tag to resources that support tags within the stack.

Usage notes

  • If a tag key defined for a resource in a template is the same as that of the stack to which the resource belongs, the tag key defined in the template is used for the resource. For example, the tag k1:v1 is defined for Resource A in the template. If you specify k1:v2 as a tag of the stack to which Resource A belongs when you create the stack by calling the CreateStack operation, k1:v1 is used as the tag of Resource A.
  • If no tags are defined in a template or a tag key defined in the template differs from that of a stack created from the template, the tag of the stack is propagated to resources defined in the template. For example, the tag k1:v1 is defined for Resource A in the template. If you specify k2:v2 as a tag of the stack to which Resource A belongs when you create the stack by calling the CreateStack operation, k1:v1,k2:v2 is used as the tag of Resource A.
  • Tags can be propagated only when you create or update stacks by calling the CreateStack or UpdateStack operation. Tags are not propagated when you add the tags to stacks by calling the TagResources operation.

Resource types that support tag propagation

Alibaba Cloud service Resource type
API Gateway
Alibaba Cloud CDN ALIYUN::CDN::Domain
Cloud Enterprise Network ALIYUN::CEN::CenInstance
Cloud Firewall ALIYUN::CLOUDFW::AddressBook
Container Service for Kubernetes
Elastic Container Instance ALIYUN::ECI::ContainerGroup
Alibaba Cloud DNS ALIYUN::DNS::Domain
Distributed Relational Database Service ALIYUN::DRDS::DrdsInstance
Elastic Compute Service
Alibaba Cloud Elasticsearch ALIYUN::ElasticSearch::Instance
Auto Scaling ALIYUN::ESS::ScalingGroup
Function Compute ALIYUN::FC::Service
Message Queue for Apache Kafka ALIYUN::KAFKA::Instance
ApsaraDB for MongoDB
Apsara File Storage NAS ALIYUN::NAS::FileSystem
Operation Orchestration Service
Object Storage Service ALIYUN::OSS::Bucket
Tablestore ALIYUN::OTS::Instance
PolarDB ALIYUN::POLARDB::DBCluster
ApsaraDB RDS
ApsaraDB for Redis
Message Queue for Apache RocketMQ ALIYUN::ROCKETMQ::Instance
Serverless App Engine ALIYUN::SAE::Application
Smart Access Gateway ALIYUN::SAG::CloudConnectNetwork
Server Load Balancer
Log Service ALIYUN::SLS::Project
Virtual Private Cloud

References

Use ROS to batch bind or update tags for cloud resources