Skip to content

untag_resource

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

Removes tags from a resource.

Parameters:

  • resource_arn (ResourceArn) –

    The Amazon Resource Name (ARN) of the resource.

  • tag_keys (TagKeyList) –

    The keys of the tags to remove from the resource.

Raises:

Examples:

Remove a tag from a governance environment Removes the team tag from the governance environment when ownership of the environment changes.

>>> client.untag_resource(resource_arn='arn:aws:assurance:us-east-1:111122223333:environment/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111', tag_keys=['team'])
Source code in docs_src/capo_assurance/_services/assurance.py
def untag_resource(
    self,
    resource_arn: "capo_assurance.types.resource_arn.ResourceArn",
    tag_keys: "capo_assurance.types.tag_key_list.TagKeyList",
    *,
    config_overrides: Optional[AssuranceClientConfig] = None,
) -> "capo_assurance.types.untag_resource_output.UntagResourceOutput":
    """<p>Removes tags from a resource.</p>

    Args:
        resource_arn: <p>The Amazon Resource Name (ARN) of the resource.</p>
        tag_keys: <p>The keys of the tags to remove from the resource.</p>

    Raises:
        capo_assurance.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action. This error occurs when the request is unauthenticated, or is authenticated but lacks permission to invoke the operation.</p>
        capo_assurance.errors.internal_server_exception.InternalServerException: <p>An internal server error occurred.</p>
        capo_assurance.errors.resource_not_found_exception.ResourceNotFoundException: <p>The requested resource was not found.</p>
        capo_assurance.errors.throttling_exception.ThrottlingException: <p>The request was throttled.</p>
        capo_assurance.errors.validation_exception.ValidationException: <p>The request failed validation.</p>
        capo_assurance.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        Remove a tag from a governance environment
        Removes the team tag from the governance environment when ownership of the environment changes.

        >>> client.untag_resource(resource_arn='arn:aws:assurance:us-east-1:111122223333:environment/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111', tag_keys=['team'])
    """

    def _handler(
        req: "OperationRequest[capo_assurance.types.untag_resource_input.UntagResourceInput]",
    ) -> OperationResponse[
        "capo_assurance.types.untag_resource_output.UntagResourceOutput"
    ]:
        import capo_assurance._operations.assurance.untag_resource

        output, http_response = (
            capo_assurance._operations.assurance.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_assurance.types.untag_resource_input.UntagResourceInput = {
        "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