Deleting custom SSM documents - 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.

Deleting custom SSM documents

If you no longer want to use a custom SSM document, you can delete it by using either the Amazon Command Line Interface (Amazon CLI) or the Amazon Systems Manager console.

To delete an SSM document (Amazon CLI)
  1. Before you delete the document, we recommend that you disassociate all instances that are associated with the document.

    Run the following command to disassociate an instance from a document.

    aws ssm delete-association --instance-id "123456789012" --name "documentName"

    There is no output if the command succeeds.

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

    Linux
    aws ssm delete-document \ --name "document-name" \ --document-version "document-version" \ --version-name "version-name"
    Windows
    aws ssm delete-document ^ --name "document-name" ^ --document-version "document-version" ^ --version-name "version-name"
    PowerShell
    Delete-SSMDocument ` -Name "document-name" ` -DocumentVersion 'document-version' ` -VersionName 'version-name'

    There is no output if the command succeeds.

    Important

    If the document-version or the version-name are not provided, all versions of the document are deleted.

To delete an SSM document (console)
  1. Open the Amazon Systems Manager console at https://console.amazonaws.cn/systems-manager/.

  2. In the navigation pane, choose Documents.

    -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 Documents in the navigation pane.

  3. Select the document you want to delete.

  4. Select Delete. When prompted to delete the document, select Delete.