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

***********************
detach_principal_policy
***********************



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

  

  Removes the specified policy from the specified certificate.

   

  **Note:** This action is deprecated and works as expected for backward compatibility, but we won't add enhancements. Use  DetachPolicy instead.

   

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

  

  .. danger::

        This operation is deprecated and may not function as expected. This operation should not be used going forward and is only kept for the purpose of backwards compatiblity.


  

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


  **Request Syntax**
  ::

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

    The name of the policy to detach.

    

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

    The principal.

     

    Valid principals are CertificateArn (arn:aws:iot:*region*:*accountId*:cert/*certificateId*), thingGroupArn (arn:aws:iot:*region*:*accountId*:thinggroup/*groupName*) and CognitoId (*region*:*id*).

    

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

  
  *   :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`

  