Skip to content

untag_resource async

untag_resource(
    resource_arn: Arn,
    tag_keys: TagKeys,
    *,
    config_overrides: Optional[AsyncOAMClientConfig] = None,
) -> UntagResourceOutput

Removes one or more tags from the specified resource.

Unlike tagging permissions in other Amazon Web Services services, to tag or untag links and sinks you must have the oam:ResourceTag permission. The iam:TagResource permission does not allow you to tag and untag links and sinks.

Parameters:

  • resource_arn (Arn) –

    The ARN of the resource that you're removing tags from.

    The ARN format of a sink is arn:aws:oam:Region:account-id:sink/sink-id

    The ARN format of a link is arn:aws:oam:Region:account-id:link/link-id

    For more information about ARN format, see CloudWatch Logs resources and operations.

  • tag_keys (TagKeys) –

    The list of tag keys to remove from the resource.

Raises:

Source code in docs_src/capo_oam/_services/async_oam.py
async def untag_resource(
    self,
    resource_arn: "capo_oam.types.arn.Arn",
    tag_keys: "capo_oam.types.tag_keys.TagKeys",
    *,
    config_overrides: Optional[AsyncOAMClientConfig] = None,
) -> "capo_oam.types.untag_resource_output.UntagResourceOutput":
    """<p>Removes one or more tags from the specified resource.</p> <important> <p>Unlike tagging permissions in other Amazon Web Services services, to tag or untag links and sinks you must have the <code>oam:ResourceTag</code> permission. The <code>iam:TagResource</code> permission does not allow you to tag and untag links and sinks.</p> </important>

    Args:
        resource_arn: <p>The ARN of the resource that you're removing tags from.</p> <p>The ARN format of a sink is <code>arn:aws:oam:<i>Region</i>:<i>account-id</i>:sink/<i>sink-id</i> </code> </p> <p>The ARN format of a link is <code>arn:aws:oam:<i>Region</i>:<i>account-id</i>:link/<i>link-id</i> </code> </p> <p>For more information about ARN format, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html">CloudWatch Logs resources and operations</a>.</p>
        tag_keys: <p>The list of tag keys to remove from the resource.</p>

    Raises:
        capo_oam.errors.resource_not_found_exception.ResourceNotFoundException: <p>The request references a resource that does not exist.</p>
        capo_oam.errors.validation_exception.ValidationException: <p>The value of a parameter in the request caused an error.</p>
        capo_oam.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_oam.types.untag_resource_input.UntagResourceInput]",
    ) -> AsyncOperationResponse[
        "capo_oam.types.untag_resource_output.UntagResourceOutput"
    ]:
        import capo_oam._operations.oamservice.untag_resource

        (
            output,
            http_response,
        ) = await capo_oam._operations.oamservice.untag_resource.async_untag_resource(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UntagResource")
    )
    input_: capo_oam.types.untag_resource_input.UntagResourceInput = {
        "resource_arn": resource_arn,
        "tag_keys": tag_keys,
    }

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