There are more AWS SDK examples available in the AWS Doc SDK Examples
Use Untag with a CLI
The following code examples show how to use Untag.
- CLI
-
- AWS CLI
-
To remove tags from a resource group
The following
untagsexample removes any tag with the specified key from the resource group itself, not its members.aws resource-groups untag \ --arnarn:aws:resource-groups:us-west-2:123456789012:group/tbq-WebServer\ --keysQueryTypeOutput:
{ "Arn": "arn:aws:resource-groups:us-west-2:123456789012:group/tbq-WebServer", "Keys": [ "QueryType" ] }For more information, see Manage tags in the AWS Resource Groups User Guide.
-
For API details, see Untag
in AWS CLI Command Reference.
-
- PowerShell
-
- Tools for PowerShell V4
-
Example 1: This example removes mentioned tag from the resource group
Remove-RGResourceTag -Arn arn:aws:resource-groups:eu-west-1:123456789012:group/workboxes -Key InstancesOutput:
Confirm Are you sure you want to perform this action? Performing the operation "Remove-RGResourceTag (Untag)" on target "arn:aws:resource-groups:eu-west-1:933303704102:group/workboxes". [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): Y Arn Keys --- ---- arn:aws:resource-groups:eu-west-1:123456789012:group/workboxes {Instances}-
For API details, see Untag in AWS Tools for PowerShell Cmdlet Reference (V4).
-
- Tools for PowerShell V5
-
Example 1: This example removes mentioned tag from the resource group
Remove-RGResourceTag -Arn arn:aws:resource-groups:eu-west-1:123456789012:group/workboxes -Key InstancesOutput:
Confirm Are you sure you want to perform this action? Performing the operation "Remove-RGResourceTag (Untag)" on target "arn:aws:resource-groups:eu-west-1:933303704102:group/workboxes". [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): Y Arn Keys --- ---- arn:aws:resource-groups:eu-west-1:123456789012:group/workboxes {Instances}-
For API details, see Untag in AWS Tools for PowerShell Cmdlet Reference (V5).
-