Skip to content

untag_resource

untag_resource(
    tag_keys: TagKeyList,
    *,
    config_overrides: Optional[RAMClientConfig] = None,
    resource_share_arn: Optional[String] = None,
    resource_arn: Optional[String] = None,
) -> UntagResourceResponse

Removes the specified tag key and value pairs from the specified resource share or managed permission.

Parameters:

  • resource_share_arn (Optional[String], default: None ) –

    Specifies the Amazon Resource Name (ARN) of the resource share that you want to remove tags from. The tags are removed from the resource share, not the resources in the resource share. You must specify either resourceShareArn, or resourceArn, but not both.

  • tag_keys (TagKeyList) –

    Specifies a list of one or more tag keys that you want to remove.

  • resource_arn (Optional[String], default: None ) –

    Specifies the Amazon Resource Name (ARN) of the managed permission that you want to remove tags from. You must specify either resourceArn, or resourceShareArn, but not both.

Raises:

Source code in docs_src/capo_ram/_services/ram.py
def untag_resource(
    self,
    tag_keys: "capo_ram.types.tag_key_list.TagKeyList",
    *,
    config_overrides: Optional[RAMClientConfig] = None,
    resource_share_arn: Optional["capo_ram.types.string.String"] = None,
    resource_arn: Optional["capo_ram.types.string.String"] = None,
) -> "capo_ram.types.untag_resource_response.UntagResourceResponse":
    """<p>Removes the specified tag key and value pairs from the specified resource share or managed permission.</p>

    Args:
        resource_share_arn: <p>Specifies the <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Name (ARN)</a> of the resource share that you want to remove tags from. The tags are removed from the resource share, not the resources in the resource share. You must specify either <code>resourceShareArn</code>, or <code>resourceArn</code>, but not both.</p>
        tag_keys: <p>Specifies a list of one or more tag keys that you want to remove.</p>
        resource_arn: <p>Specifies the <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Name (ARN)</a> of the managed permission that you want to remove tags from. You must specify either <code>resourceArn</code>, or <code>resourceShareArn</code>, but not both.</p>

    Raises:
        capo_ram.errors.invalid_parameter_exception.InvalidParameterException: <p>The operation failed because a parameter you specified isn't valid.</p>
        capo_ram.errors.malformed_arn_exception.MalformedArnException: <p>The operation failed because the specified <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Name (ARN)</a> has a format that isn't valid.</p>
        capo_ram.errors.server_internal_exception.ServerInternalException: <p>The operation failed because the service could not respond to the request due to an internal problem. Try again later.</p>
        capo_ram.errors.service_unavailable_exception.ServiceUnavailableException: <p>The operation failed because the service isn't available. Try again later.</p>
        capo_ram.errors.unknown_resource_exception.UnknownResourceException: <p>The operation failed because a specified resource couldn't be found.</p>
        capo_ram.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

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

        output, http_response = (
            capo_ram._operations.amazon_resource_sharing.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_ram.types.untag_resource_request.UntagResourceRequest = {
        "tag_keys": tag_keys
    }
    if resource_share_arn is not None:
        input_["resource_share_arn"] = resource_share_arn
    if resource_arn is not None:
        input_["resource_arn"] = resource_arn

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