取消命令 - Amazon Systems Manager
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 中国的 Amazon Web Services 服务入门 (PDF)

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

取消命令

只要服务指明命令处于 Pending (待处理) 或 Executing (正在执行) 状态,您就可以尝试取消命令。但是,即使命令仍处于其中某种状态,我们也无法保证该命令将被取消并且基础流程将停止。

使用控制台取消命令
  1. 访问 https://console.aws.amazon.com/systems-manager/,打开 Amazon Systems Manager 控制台。

  2. 在导航窗格中,选择 Run Command

    -或者-

    如果首先打开 Amazon Systems Manager 主页,选择菜单图标 ( 
    The menu icon
  ) 以打开导航窗格,然后选择 Run Command

  3. 选择要取消的命令调用。

  4. 选择取消命令

使用 Amazon CLI 取消命令

运行以下命令。将每个示例资源占位符替换为您自己的信息。

Linux & macOS
aws ssm cancel-command \ --command-id "command-ID" \ --instance-ids "instance-ID"
Windows
aws ssm cancel-command ^ --command-id "command-ID" ^ --instance-ids "instance-ID"

有关已取消命令的状态的信息,请参阅 了解命令状态