将 DeleteGroup 与 CLI 配合使用 - AWS SDK 代码示例

AWS 文档 SDK 示例 GitHub 存储库中还有更多 AWS SDK 示例。

DeleteGroup 与 CLI 配合使用

以下代码示例演示如何使用 DeleteGroup

CLI
AWS CLI

更新资源组的描述

以下 delete-group 示例更新了指定资源组。

aws resource-groups delete-group \ --group-name tbq-WebServer

输出:

{ "Group": { "GroupArn": "arn:aws:resource-groups:us-west-2:1234567890:group/tbq-WebServer", "Name": "tbq-WebServer" } }

有关更多信息,请参阅《AWS 用户指南》中的删除组

  • 有关 API 详细信息,请参阅《AWS CLI 命令参考》中的 DeleteGroup

PowerShell
Tools for PowerShell V4

示例 1:此示例移除指定的资源组

Remove-RGGroup -GroupName non-tag-cfn-elbv2

输出

Confirm Are you sure you want to perform this action? Performing the operation "Remove-RGGroup (DeleteGroup)" on target "non-tag-cfn-elbv2". [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): Y Description GroupArn Name ----------- -------- ---- arn:aws:resource-groups:eu-west-1:123456789012:group/non-tag-cfn-elbv2 non-tag-cfn-elbv2
  • 有关 API 详细信息,请参阅《AWS Tools for PowerShell Cmdlet Reference (V4)》中的 DeleteGroup

Tools for PowerShell V5

示例 1:此示例移除指定的资源组

Remove-RGGroup -GroupName non-tag-cfn-elbv2

输出

Confirm Are you sure you want to perform this action? Performing the operation "Remove-RGGroup (DeleteGroup)" on target "non-tag-cfn-elbv2". [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): Y Description GroupArn Name ----------- -------- ---- arn:aws:resource-groups:eu-west-1:123456789012:group/non-tag-cfn-elbv2 non-tag-cfn-elbv2
  • 有关 API 详细信息,请参阅《AWS Tools for PowerShell Cmdlet Reference (V5)》中的 DeleteGroup