Skip to content

remove_permission

remove_permission(
    *,
    config_overrides: Optional[CloudWatchEventsClientConfig] = None,
    statement_id: Optional[StatementId] = None,
    remove_all_permissions: Optional[Boolean] = None,
    event_bus_name: Optional[NonPartnerEventBusName] = None,
) -> None

Revokes the permission of another Amazon Web Services account to be able to put events to the specified event bus. Specify the account to revoke by the StatementId value that you associated with the account when you granted it permission with PutPermission. You can find the StatementId by using DescribeEventBus.

Parameters:

  • statement_id (Optional[StatementId], default: None ) –

    The statement ID corresponding to the account that is no longer allowed to put events to the default event bus.

  • remove_all_permissions (Optional[Boolean], default: None ) –

    Specifies whether to remove all permissions.

  • event_bus_name (Optional[NonPartnerEventBusName], default: None ) –

    The name of the event bus to revoke permissions for. If you omit this, the default event bus is used.

Raises:

Source code in docs_src/capo_cloudwatch_events/_services/cloud_watch_events.py
def remove_permission(
    self,
    *,
    config_overrides: Optional[CloudWatchEventsClientConfig] = None,
    statement_id: Optional[
        "capo_cloudwatch_events.types.statement_id.StatementId"
    ] = None,
    remove_all_permissions: Optional[
        "capo_cloudwatch_events.types.boolean.Boolean"
    ] = None,
    event_bus_name: Optional[
        "capo_cloudwatch_events.types.non_partner_event_bus_name.NonPartnerEventBusName"
    ] = None,
) -> None:
    """<p>Revokes the permission of another Amazon Web Services account to be able to put events to the specified event bus. Specify the account to revoke by the <code>StatementId</code> value that you associated with the account when you granted it permission with <code>PutPermission</code>. You can find the <code>StatementId</code> by using <a href="https://docs.aws.amazon.com/eventbridge/latest/APIReference/API_DescribeEventBus.html">DescribeEventBus</a>.</p>

    Args:
        statement_id: <p>The statement ID corresponding to the account that is no longer allowed to put events to the default event bus.</p>
        remove_all_permissions: <p>Specifies whether to remove all permissions.</p>
        event_bus_name: <p>The name of the event bus to revoke permissions for. If you omit this, the default event bus is used.</p>

    Raises:
        capo_cloudwatch_events.errors.concurrent_modification_exception.ConcurrentModificationException: <p>There is concurrent modification on a rule, target, archive, or replay.</p>
        capo_cloudwatch_events.errors.internal_exception.InternalException: <p>This exception occurs due to unexpected causes.</p>
        capo_cloudwatch_events.errors.operation_disabled_exception.OperationDisabledException: <p>The operation you are attempting is not available in this region.</p>
        capo_cloudwatch_events.errors.resource_not_found_exception.ResourceNotFoundException: <p>An entity that you specified does not exist.</p>
        capo_cloudwatch_events.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_cloudwatch_events.types.remove_permission_request.RemovePermissionRequest]",
    ) -> OperationResponse[None]:
        import capo_cloudwatch_events._operations.aws_events.remove_permission

        output, http_response = (
            capo_cloudwatch_events._operations.aws_events.remove_permission.remove_permission(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("RemovePermission")
    )
    input_: capo_cloudwatch_events.types.remove_permission_request.RemovePermissionRequest = {}
    if statement_id is not None:
        input_["statement_id"] = statement_id
    if remove_all_permissions is not None:
        input_["remove_all_permissions"] = remove_all_permissions
    if event_bus_name is not None:
        input_["event_bus_name"] = event_bus_name

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