Propagate tags from Elastic Compute Service (ECS) instances to associated disks, elastic network interfaces (ENIs), elastic IP addresses (EIPs), snapshots, and custom images in bulk by using a CloudOps Orchestration Service (OOS) public template.
Background information
In this example, the tag team:dev is attached to multiple ECS instances, and all related resources must carry the same tag. Some associated resources are missing it. The OOS public template ACS-TAG-ExtendEcsInstanceTagsByInputParams automatically identifies non-compliant resources and propagates the specified tags from the ECS instances to them.
Procedure
-
Log on to the OOS console.
-
In the left-side navigation pane, choose .
-
In the top navigation bar, select the desired region.
NoteBy default, OOS manages resources only in the region where it is deployed. Although you can call API operations in other regions by specifying the region ID in the ACS::ExecuteAPI action, this approach is not recommended. Make sure the OOS region matches the region of the ECS instances you want to manage. For more information, see Limits.
-
On the Public Template page, find the ACS-TAG-ExtendEcsInstanceTagsByInputParams template and click Create Execution.
-
On the Basic Information page, configure the basic information and click Next Step: Parameter Settings.
For this example, use the default settings on the Basic Information page.
NoteFor Execution Mode, select Automatic. This runs all tasks in the template automatically rather than individually.
-
On the Parameter Settings page, configure the parameters and click Next Step: OK.
-
For Region ID, select the region where your ECS instances are located.
-
For TargetInstance, select the target ECS instances.
Multiple selection methods are available. In this example, select By Instance Tags to filter ECS instances with the
team:devtag. -
In the TagKeys field, enter the tag key that you want to inherit from the ECS instances.
In this example, enter the tag key
team. You can enter multiple tag keys. -
Set the ResourceTypes parameter to the desired resource type.
Supported resource types include disk, snapshot, eni, eip, and image. You can select multiple resource types. In this example, all resource types are selected.
-
Choose whether to turn on the switch Whether to overwrite the tag value if the tag key is the same.
In this example, the switch is turned on. If the tag keys are the same but the tag values differ, the new tag value overwrites the original value.
-
Keep the default settings for the RateControl and OOSAssumeRole parameters.
-
-
After you confirm the settings, click Create.
Result
A Success status indicates that the team:dev tag has been propagated to the associated resources of the specified ECS instances. To verify, check the ECS console for the tag on the corresponding resources.