:doc:`CloudFront <../../cloudfront>` / Client / delete_origin_access_control

****************************
delete_origin_access_control
****************************



.. py:method:: CloudFront.Client.delete_origin_access_control(**kwargs)

  

  Deletes a CloudFront origin access control.

   

  You cannot delete an origin access control if it's in use. First, update all distributions to remove the origin access control from all origins, then delete the origin access control.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2020-05-31/DeleteOriginAccessControl>`_  


  **Request Syntax**
  ::

    response = client.delete_origin_access_control(
        Id='string',
        IfMatch='string'
    )
    
  :type Id: string
  :param Id: **[REQUIRED]** 

    The unique identifier of the origin access control that you are deleting.

    

  
  :type IfMatch: string
  :param IfMatch: 

    The current version ( ``ETag`` value) of the origin access control that you are deleting.

    

  
  
  :returns: None
  **Exceptions**
  
  *   :py:class:`CloudFront.Client.exceptions.PreconditionFailed`

  
  *   :py:class:`CloudFront.Client.exceptions.AccessDenied`

  
  *   :py:class:`CloudFront.Client.exceptions.OriginAccessControlInUse`

  
  *   :py:class:`CloudFront.Client.exceptions.NoSuchOriginAccessControl`

  
  *   :py:class:`CloudFront.Client.exceptions.InvalidIfMatchVersion`

  