Canceling a command - Amazon Systems Manager
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Canceling a command

You can attempt to cancel a command as long as the service shows that it's in either a Pending or Executing state. However, even if a command is still in one of these states, we can't guarantee that the command will be canceled and the underlying process stopped.

To cancel a command using the console
  1. Open the Amazon Systems Manager console at https://console.amazonaws.cn/systems-manager/.

  2. In the navigation pane, choose Run Command.

    -or-

    If the Amazon Systems Manager home page opens first, choose the menu icon ( 
    The menu icon
  ) to open the navigation pane, and then choose Run Command.

  3. Select the command invocation that you want to cancel.

  4. Choose Cancel command.

To cancel a command using the Amazon CLI

Run the following command. Replace each example resource placeholder with your own information.

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"

For information about the status of a canceled command, see Understanding command statuses.