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

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

DeletePlacementGroup 与 CLI 配合使用

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

CLI
AWS CLI

删除置放群组

此示例命令将删除指定的置放群组。

命令:

aws ec2 delete-placement-group --group-name my-cluster
PowerShell
Tools for PowerShell V4

示例 1:此示例删除指定的置放群组。除非您还指定了 Force 参数,否则在操作继续之前,系统会提示您进行确认。

Remove-EC2PlacementGroup -GroupName my-placement-group

输出

Confirm Are you sure you want to perform this action? Performing operation "Remove-EC2PlacementGroup (DeletePlacementGroup)" on Target "my-placement-group". [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"):
  • 有关 API 详细信息,请参阅《AWS Tools for PowerShell Cmdlet Reference (V4)》中的 DeletePlacementGroup

Tools for PowerShell V5

示例 1:此示例删除指定的置放群组。除非您还指定了 Force 参数,否则在操作继续之前,系统会提示您进行确认。

Remove-EC2PlacementGroup -GroupName my-placement-group

输出

Confirm Are you sure you want to perform this action? Performing operation "Remove-EC2PlacementGroup (DeletePlacementGroup)" on Target "my-placement-group". [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"):
  • 有关 API 详细信息,请参阅《AWS Tools for PowerShell Cmdlet Reference (V5)》中的 DeletePlacementGroup