Skip to content

untag_resource

untag_resource(
    resource_arn: Arn,
    tag_keys: TagKeyList,
    *,
    config_overrides: Optional[EventBridgeClientConfig] = None,
) -> UntagResourceResponse

Removes one or more tags from the specified EventBridge resource. In Amazon EventBridge, rules and event buses can be tagged.

Parameters:

  • resource_arn (Arn) –

    The ARN of the EventBridge resource from which you are removing tags.

  • tag_keys (TagKeyList) –

    The list of tag keys to remove from the resource.

Raises:

  • ConcurrentModificationException –

    There is concurrent modification on a rule, target, archive, or replay.

  • InternalException –

    This exception occurs due to unexpected causes.

  • ManagedRuleException –

    This rule was created by an Amazon Web Services service on behalf of your account. It is managed by that service. If you see this error in response to DeleteRule or RemoveTargets, you can use the Force parameter in those calls to delete the rule or remove targets from the rule. You cannot modify these managed rules by using DisableRule, EnableRule, PutTargets, PutRule, TagResource, or UntagResource.

  • ResourceNotFoundException –

    An entity that you specified does not exist.

  • UnknownServiceError –

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

Source code in docs_src/capo_eventbridge/_services/event_bridge.py
def untag_resource(
    self,
    resource_arn: "capo_eventbridge.types.arn.Arn",
    tag_keys: "capo_eventbridge.types.tag_key_list.TagKeyList",
    *,
    config_overrides: Optional[EventBridgeClientConfig] = None,
) -> "capo_eventbridge.types.untag_resource_response.UntagResourceResponse":
    """<p>Removes one or more tags from the specified EventBridge resource. In Amazon EventBridge, rules and event buses can be tagged.</p>

    Args:
        resource_arn: <p>The ARN of the EventBridge resource from which you are removing tags.</p>
        tag_keys: <p>The list of tag keys to remove from the resource.</p>

    Raises:
        capo_eventbridge.errors.concurrent_modification_exception.ConcurrentModificationException: <p>There is concurrent modification on a rule, target, archive, or replay.</p>
        capo_eventbridge.errors.internal_exception.InternalException: <p>This exception occurs due to unexpected causes.</p>
        capo_eventbridge.errors.managed_rule_exception.ManagedRuleException: <p>This rule was created by an Amazon Web Services service on behalf of your account. It is managed by that service. If you see this error in response to <code>DeleteRule</code> or <code>RemoveTargets</code>, you can use the <code>Force</code> parameter in those calls to delete the rule or remove targets from the rule. You cannot modify these managed rules by using <code>DisableRule</code>, <code>EnableRule</code>, <code>PutTargets</code>, <code>PutRule</code>, <code>TagResource</code>, or <code>UntagResource</code>. </p>
        capo_eventbridge.errors.resource_not_found_exception.ResourceNotFoundException: <p>An entity that you specified does not exist.</p>
        capo_eventbridge.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_eventbridge.types.untag_resource_request.UntagResourceRequest]",
    ) -> OperationResponse[
        "capo_eventbridge.types.untag_resource_response.UntagResourceResponse"
    ]:
        import capo_eventbridge._operations.aws_events.untag_resource

        output, http_response = (
            capo_eventbridge._operations.aws_events.untag_resource.untag_resource(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UntagResource")
    )
    input_: capo_eventbridge.types.untag_resource_request.UntagResourceRequest = {
        "resource_arn": resource_arn,
        "tag_keys": tag_keys,
    }

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