delete_origin_access_control(
id: string,
*,
config_overrides: Optional[CloudFrontClientConfig] = None,
if_match: Optional[string] = None,
) -> None
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.
Parameters:
-
id
(string)
–
The unique identifier of the origin access control that you are deleting.
-
if_match
(Optional[string], default:
None
)
–
The current version (ETag value) of the origin access control that you are deleting.
Raises:
Source code in docs_src/capo_cloudfront/_services/cloud_front.py
| def delete_origin_access_control(
self,
id: "capo_cloudfront.types.string.string",
*,
config_overrides: Optional[CloudFrontClientConfig] = None,
if_match: Optional["capo_cloudfront.types.string.string"] = None,
) -> None:
"""<p>Deletes a CloudFront origin access control.</p> <p>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.</p>
Args:
id: <p>The unique identifier of the origin access control that you are deleting.</p>
if_match: <p>The current version (<code>ETag</code> value) of the origin access control that you are deleting.</p>
Raises:
capo_cloudfront.errors.access_denied.AccessDenied: <p>Access denied.</p>
capo_cloudfront.errors.invalid_if_match_version.InvalidIfMatchVersion: <p>The <code>If-Match</code> version is missing or not valid.</p>
capo_cloudfront.errors.no_such_origin_access_control.NoSuchOriginAccessControl: <p>The origin access control does not exist.</p>
capo_cloudfront.errors.origin_access_control_in_use.OriginAccessControlInUse: <p>Cannot delete the origin access control because it's in use by one or more distributions.</p>
capo_cloudfront.errors.precondition_failed.PreconditionFailed: <p>The precondition in one or more of the request fields evaluated to <code>false</code>.</p>
capo_cloudfront.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_cloudfront.types.delete_origin_access_control_request.DeleteOriginAccessControlRequest]",
) -> OperationResponse[None]:
import capo_cloudfront._operations.cloudfront2020_05_31.delete_origin_access_control
output, http_response = (
capo_cloudfront._operations.cloudfront2020_05_31.delete_origin_access_control.delete_origin_access_control(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("DeleteOriginAccessControl")
)
input_: capo_cloudfront.types.delete_origin_access_control_request.DeleteOriginAccessControlRequest = {
"id": id
}
if if_match is not None:
input_["if_match"] = if_match
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|