:doc:`SSM <../../ssm>` / Client / delete_document

***************
delete_document
***************



.. py:method:: SSM.Client.delete_document(**kwargs)

  

  Deletes the Amazon Web Services Systems Manager document (SSM document) and all managed node associations to the document.

   

  Before you delete the document, we recommend that you use  DeleteAssociation to disassociate all managed nodes that are associated with the document.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DeleteDocument>`_  


  **Request Syntax**
  ::

    response = client.delete_document(
        Name='string',
        DocumentVersion='string',
        VersionName='string',
        Force=True|False
    )
    
  :type Name: string
  :param Name: **[REQUIRED]** 

    The name of the document.

    

  
  :type DocumentVersion: string
  :param DocumentVersion: 

    The version of the document that you want to delete. If not provided, all versions of the document are deleted.

    

  
  :type VersionName: string
  :param VersionName: 

    The version name of the document that you want to delete. If not provided, all versions of the document are deleted.

    

  
  :type Force: boolean
  :param Force: 

    Some SSM document types require that you specify a ``Force`` flag before you can delete the document. For example, you must specify a ``Force`` flag to delete a document of type ``ApplicationConfigurationSchema``. You can restrict access to the ``Force`` flag in an Identity and Access Management (IAM) policy.

    

  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {}
      
    **Response Structure**

    

    - *(dict) --* 
  
  **Exceptions**
  
  *   :py:class:`SSM.Client.exceptions.InternalServerError`

  
  *   :py:class:`SSM.Client.exceptions.InvalidDocument`

  
  *   :py:class:`SSM.Client.exceptions.InvalidDocumentOperation`

  
  *   :py:class:`SSM.Client.exceptions.AssociatedInstances`

  
  *   :py:class:`SSM.Client.exceptions.TooManyUpdates`

  