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 the tag feature in the stack.
Usage notes
- If a resource in a template and the stack to which the resource belongs have the same
tag key, the following rules apply:
- ROS stack: The tag of the resource in the template is used for the resource. For example,
the
k1:v1
tag is defined for Resource A in the template. If you specify thek1:v2
tag for the ROS stack to which Resource A belongs when you create the stack by calling the CreateStack operation, thek1:v1
tag is used for Resource A. - Terraform stack: The tag of the stack is used for the resource. For example, the
k1:v1
tag is defined for Resource A in the template. If you specify thek1:v2
tag for the Terraform stack to which Resource A belongs when you create the stack by calling the CreateStack operation, thek1:v2
tag is used for Resource A.
- ROS stack: The tag of the resource in the template is used for the resource. For example,
the
- If a resource in a template has no tags but the stack to which the resource belongs
has a tag, or if the resource and the stack have different tag keys, the tag of the
stack is propagated to the resource. For example, the
k1:v1
tag is defined for Resource A in the template. If you specify thek2:v2
tag for the stack to which Resource A belongs when you create the stack by calling the CreateStack operation, thek1:v1 and k2:v2
tags are used for Resource A. - Tags can be propagated only when you call the CreateStack operation to create a stack or the UpdateStack operation to update a stack. When you call the TagResources operation to add tags to a stack, tags are not propagated.
Resource types that support tag propagation in an ROS stack
Resource types that support tag propagation in a Terraform stack
For more information, see the "Resources that support user tag propagation of stacks" section of the ROS resources supported by Terraform topic.
References
Use ROS to add tags to or update tags for multiple cloud resources at a time