Skip to content

untag_resource async

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

Removes tags from a resource in Shield.

Parameters:

  • resource_arn (ResourceArn) –

    The Amazon Resource Name (ARN) of the resource that you want to remove tags from.

  • tag_keys (TagKeyList) –

    The tag key for each tag that you want to remove from the resource.

Raises:

  • InternalErrorException –

    Exception that indicates that a problem occurred with the service infrastructure. You can retry the request.

  • InvalidParameterException –

    Exception that indicates that the parameters passed to the API are invalid. If available, this exception includes details in additional properties.

  • InvalidResourceException –

    Exception that indicates that the resource is invalid. You might not have access to the resource, or the resource might not exist.

  • ResourceNotFoundException –

    Exception indicating the specified resource does not exist. If available, this exception includes details in additional properties.

  • UnknownServiceError –

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

Source code in docs_src/capo_shield/_services/async_shield.py
async def untag_resource(
    self,
    resource_arn: "capo_shield.types.resource_arn.ResourceArn",
    tag_keys: "capo_shield.types.tag_key_list.TagKeyList",
    *,
    config_overrides: Optional[AsyncShieldClientConfig] = None,
) -> "capo_shield.types.untag_resource_response.UntagResourceResponse":
    """<p>Removes tags from a resource in Shield.</p>

    Args:
        resource_arn: <p>The Amazon Resource Name (ARN) of the resource that you want to remove tags from.</p>
        tag_keys: <p>The tag key for each tag that you want to remove from the resource.</p>

    Raises:
        capo_shield.errors.internal_error_exception.InternalErrorException: <p>Exception that indicates that a problem occurred with the service infrastructure. You can retry the request.</p>
        capo_shield.errors.invalid_parameter_exception.InvalidParameterException: <p>Exception that indicates that the parameters passed to the API are invalid. If available, this exception includes details in additional properties. </p>
        capo_shield.errors.invalid_resource_exception.InvalidResourceException: <p>Exception that indicates that the resource is invalid. You might not have access to the resource, or the resource might not exist.</p>
        capo_shield.errors.resource_not_found_exception.ResourceNotFoundException: <p>Exception indicating the specified resource does not exist. If available, this exception includes details in additional properties. </p>
        capo_shield.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_shield.types.untag_resource_request.UntagResourceRequest]",
    ) -> AsyncOperationResponse[
        "capo_shield.types.untag_resource_response.UntagResourceResponse"
    ]:
        import capo_shield._operations.aws_shield_20160616.untag_resource

        (
            output,
            http_response,
        ) = await capo_shield._operations.aws_shield_20160616.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_shield.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