文档 AWS SDK 示例 GitHub 存储库中还有更多 S AWS DK 示例
本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。
将 Untag 与 CLI 配合使用
以下代码示例演示如何使用 Untag。
- CLI
-
- AWS CLI
-
从资源中删除标签
以下
untags示例从资源组(而非其成员)中删除具有指定键的所有标签。aws resource-groups untag \ --arnarn:aws:resource-groups:us-west-2:123456789012:group/tbq-WebServer\ --keysQueryType输出:
{ "Arn": "arn:aws:resource-groups:us-west-2:123456789012:group/tbq-WebServer", "Keys": [ "QueryType" ] }有关更多信息,请参阅《AWS 资源组用户指南》中的管理标签。
-
有关 API 详细信息,请参阅《AWS CLI 命令参考》中的 Untag
。
-
- PowerShell
-
- 适用于 PowerShell V4 的工具
-
示例 1:此示例从资源组中删除提及的标签
Remove-RGResourceTag -Arn arn:aws:resource-groups:eu-west-1:123456789012:group/workboxes -Key Instances输出:
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}-
有关 API 的详细信息,请参阅 AWS Tools for PowerShell Cmdlet 参考文档 (V4) 中的取消标记。
-
- 适用于 PowerShell V5 的工具
-
示例 1:此示例从资源组中删除提及的标签
Remove-RGResourceTag -Arn arn:aws:resource-groups:eu-west-1:123456789012:group/workboxes -Key Instances输出:
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}-
有关 API 的详细信息,请参阅 AWS Tools for PowerShell Cmdlet 参考文档 (V5) 中的取消标记。
-
Tag
UpdateGroup