Skip to content

delete_resource_policy

delete_resource_policy(
    resource_arn: string, *, config_overrides: Optional[CloudFrontClientConfig] = None
) -> None

Deletes the resource policy attached to the CloudFront resource.

Parameters:

  • resource_arn (string) –

    The Amazon Resource Name (ARN) of the CloudFront resource for which the resource policy should be deleted.

Raises:

Source code in docs_src/capo_cloudfront/_services/cloud_front.py
def delete_resource_policy(
    self,
    resource_arn: "capo_cloudfront.types.string.string",
    *,
    config_overrides: Optional[CloudFrontClientConfig] = None,
) -> None:
    """<p>Deletes the resource policy attached to the CloudFront resource.</p>

    Args:
        resource_arn: <p>The Amazon Resource Name (ARN) of the CloudFront resource for which the resource policy should be deleted.</p>

    Raises:
        capo_cloudfront.errors.access_denied.AccessDenied: <p>Access denied.</p>
        capo_cloudfront.errors.entity_not_found.EntityNotFound: <p>The entity was not found.</p>
        capo_cloudfront.errors.illegal_delete.IllegalDelete: <p>Deletion is not allowed for this entity.</p>
        capo_cloudfront.errors.invalid_argument.InvalidArgument: <p>An argument is invalid.</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.unsupported_operation.UnsupportedOperation: <p>This operation is not supported in this Amazon Web Services Region.</p>
        capo_cloudfront.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_cloudfront.types.delete_resource_policy_request.DeleteResourcePolicyRequest]",
    ) -> OperationResponse[None]:
        import capo_cloudfront._operations.cloudfront2020_05_31.delete_resource_policy

        output, http_response = (
            capo_cloudfront._operations.cloudfront2020_05_31.delete_resource_policy.delete_resource_policy(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteResourcePolicy")
    )
    input_: capo_cloudfront.types.delete_resource_policy_request.DeleteResourcePolicyRequest = {
        "resource_arn": resource_arn
    }

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output