Skip to content

untag_resource async

untag_resource(
    resource_arn: AmazonResourceName,
    tag_keys: TagKeyList,
    *,
    config_overrides: Optional[AsyncCloudWatchLogsClientConfig] = None,
) -> None

Removes one or more tags from the specified resource.

Parameters:

  • resource_arn (AmazonResourceName) –

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

    The ARN format of a log group is arn:aws:logs:Region:account-id:log-group:log-group-name

    The ARN format of a destination is arn:aws:logs:Region:account-id:destination:destination-name

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

  • tag_keys (TagKeyList) –

    The list of tag keys to remove from the resource.

Raises:

Source code in docs_src/capo_cloudwatch_logs/_services/async_cloud_watch_logs.py
async def untag_resource(
    self,
    resource_arn: "capo_cloudwatch_logs.types.amazon_resource_name.AmazonResourceName",
    tag_keys: "capo_cloudwatch_logs.types.tag_key_list.TagKeyList",
    *,
    config_overrides: Optional[AsyncCloudWatchLogsClientConfig] = None,
) -> None:
    """<p>Removes one or more tags from the specified resource.</p>

    Args:
        resource_arn: <p>The ARN of the CloudWatch Logs resource that you're removing tags from.</p> <p>The ARN format of a log group is <code>arn:aws:logs:<i>Region</i>:<i>account-id</i>:log-group:<i>log-group-name</i> </code> </p> <p>The ARN format of a destination is <code>arn:aws:logs:<i>Region</i>:<i>account-id</i>:destination:<i>destination-name</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_cloudwatch_logs.errors.invalid_parameter_exception.InvalidParameterException: <p>A parameter is specified incorrectly.</p>
        capo_cloudwatch_logs.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource does not exist.</p>
        capo_cloudwatch_logs.errors.service_unavailable_exception.ServiceUnavailableException: <p>The service cannot complete the request.</p>
        capo_cloudwatch_logs.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_cloudwatch_logs.types.untag_resource_request.UntagResourceRequest]",
    ) -> AsyncOperationResponse[None]:
        import capo_cloudwatch_logs._operations.logs_20140328.untag_resource

        (
            output,
            http_response,
        ) = await capo_cloudwatch_logs._operations.logs_20140328.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_cloudwatch_logs.types.untag_resource_request.UntagResourceRequest = {
        "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