:doc:`IoT <../../iot>` / Client / detach_policy

*************
detach_policy
*************



.. py:method:: IoT.Client.detach_policy(**kwargs)

  

  Detaches a policy from the specified target.

   

  .. note::

    

    Because of the distributed nature of Amazon Web Services, it can take up to five minutes after a policy is detached before it's ready to be deleted.

    

   

  Requires permission to access the `DetachPolicy <https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions>`__ action.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DetachPolicy>`_  


  **Request Syntax**
  ::

    response = client.detach_policy(
        policyName='string',
        target='string'
    )
    
  :type policyName: string
  :param policyName: **[REQUIRED]** 

    The policy to detach.

    

  
  :type target: string
  :param target: **[REQUIRED]** 

    The target from which the policy will be detached.

    

  
  
  :returns: None
  **Exceptions**
  
  *   :py:class:`IoT.Client.exceptions.InvalidRequestException`

  
  *   :py:class:`IoT.Client.exceptions.ThrottlingException`

  
  *   :py:class:`IoT.Client.exceptions.UnauthorizedException`

  
  *   :py:class:`IoT.Client.exceptions.ServiceUnavailableException`

  
  *   :py:class:`IoT.Client.exceptions.InternalFailureException`

  
  *   :py:class:`IoT.Client.exceptions.LimitExceededException`

  