Skip to content

delete_resource_policy async

delete_resource_policy(
    resource_arn: ResourceArn,
    *,
    config_overrides: Optional[AsyncCloudTrailClientConfig] = None,
) -> DeleteResourcePolicyResponse

Deletes the resource-based policy attached to the CloudTrail event data store, dashboard, or channel.

Parameters:

  • resource_arn (ResourceArn) –

    The Amazon Resource Name (ARN) of the CloudTrail event data store, dashboard, or channel you're deleting the resource-based policy from.

    Example event data store ARN format: arn:aws:cloudtrail:us-east-2:123456789012:eventdatastore/EXAMPLE-f852-4e8f-8bd1-bcf6cEXAMPLE

    Example dashboard ARN format: arn:aws:cloudtrail:us-east-1:123456789012:dashboard/exampleDash

    Example channel ARN format: arn:aws:cloudtrail:us-east-2:123456789012:channel/01234567890

Raises:

  • ConflictException –

    This exception is thrown when the specified resource is not ready for an operation. This can occur when you try to run an operation on a resource before CloudTrail has time to fully load the resource, or because another operation is modifying the resource. If this exception occurs, wait a few minutes, and then try the operation again.

  • OperationNotPermittedException –

    This exception is thrown when the requested operation is not permitted.

  • ResourceARNNotValidException –

    This exception is thrown when the provided resource does not exist, or the ARN format of the resource is not valid.

    The following is the format of an event data store ARN: arn:aws:cloudtrail:us-east-2:123456789012:eventdatastore/EXAMPLE-f852-4e8f-8bd1-bcf6cEXAMPLE

    The following is the format of a dashboard ARN: arn:aws:cloudtrail:us-east-1:123456789012:dashboard/exampleDash

    The following is the format of a channel ARN: arn:aws:cloudtrail:us-east-2:123456789012:channel/01234567890

  • ResourceNotFoundException –

    This exception is thrown when the specified resource is not found.

  • ResourcePolicyNotFoundException –

    This exception is thrown when the specified resource policy is not found.

  • ResourceTypeNotSupportedException –

    This exception is thrown when the specified resource type is not supported by CloudTrail.

  • UnsupportedOperationException –

    This exception is thrown when the requested operation is not supported.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_cloudtrail/_services/async_cloud_trail.py
async def delete_resource_policy(
    self,
    resource_arn: "capo_cloudtrail.types.resource_arn.ResourceArn",
    *,
    config_overrides: Optional[AsyncCloudTrailClientConfig] = None,
) -> "capo_cloudtrail.types.delete_resource_policy_response.DeleteResourcePolicyResponse":
    """<p> Deletes the resource-based policy attached to the CloudTrail event data store, dashboard, or channel. </p>

    Args:
        resource_arn: <p> The Amazon Resource Name (ARN) of the CloudTrail event data store, dashboard, or channel you're deleting the resource-based policy from.</p> <p>Example event data store ARN format: <code>arn:aws:cloudtrail:us-east-2:123456789012:eventdatastore/EXAMPLE-f852-4e8f-8bd1-bcf6cEXAMPLE</code> </p> <p>Example dashboard ARN format: <code>arn:aws:cloudtrail:us-east-1:123456789012:dashboard/exampleDash</code> </p> <p>Example channel ARN format: <code>arn:aws:cloudtrail:us-east-2:123456789012:channel/01234567890</code> </p>

    Raises:
        capo_cloudtrail.errors.conflict_exception.ConflictException: <p>This exception is thrown when the specified resource is not ready for an operation. This can occur when you try to run an operation on a resource before CloudTrail has time to fully load the resource, or because another operation is modifying the resource. If this exception occurs, wait a few minutes, and then try the operation again.</p>
        capo_cloudtrail.errors.operation_not_permitted_exception.OperationNotPermittedException: <p>This exception is thrown when the requested operation is not permitted.</p>
        capo_cloudtrail.errors.resource_arn_not_valid_exception.ResourceARNNotValidException: <p> This exception is thrown when the provided resource does not exist, or the ARN format of the resource is not valid. </p> <p>The following is the format of an event data store ARN: <code>arn:aws:cloudtrail:us-east-2:123456789012:eventdatastore/EXAMPLE-f852-4e8f-8bd1-bcf6cEXAMPLE</code> </p> <p>The following is the format of a dashboard ARN: <code>arn:aws:cloudtrail:us-east-1:123456789012:dashboard/exampleDash</code> </p> <p>The following is the format of a channel ARN: <code>arn:aws:cloudtrail:us-east-2:123456789012:channel/01234567890</code> </p>
        capo_cloudtrail.errors.resource_not_found_exception.ResourceNotFoundException: <p>This exception is thrown when the specified resource is not found.</p>
        capo_cloudtrail.errors.resource_policy_not_found_exception.ResourcePolicyNotFoundException: <p> This exception is thrown when the specified resource policy is not found. </p>
        capo_cloudtrail.errors.resource_type_not_supported_exception.ResourceTypeNotSupportedException: <p>This exception is thrown when the specified resource type is not supported by CloudTrail.</p>
        capo_cloudtrail.errors.unsupported_operation_exception.UnsupportedOperationException: <p>This exception is thrown when the requested operation is not supported.</p>
        capo_cloudtrail.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_cloudtrail.types.delete_resource_policy_request.DeleteResourcePolicyRequest]",
    ) -> AsyncOperationResponse[
        "capo_cloudtrail.types.delete_resource_policy_response.DeleteResourcePolicyResponse"
    ]:
        import capo_cloudtrail._operations.cloud_trail_20131101.delete_resource_policy

        (
            output,
            http_response,
        ) = await capo_cloudtrail._operations.cloud_trail_20131101.delete_resource_policy.async_delete_resource_policy(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

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

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output