Skip to content

untag_resource

untag_resource(
    resource_id: ResourceId,
    tag_key_list: TagKeyList,
    *,
    config_overrides: Optional[CloudHSMV2ClientConfig] = None,
) -> UntagResourceResponse

Removes the specified tag or tags from the specified CloudHSM cluster.

Cross-account use: No. You cannot perform this operation on an CloudHSM resource in a different Amazon Web Services account.

Parameters:

  • resource_id (ResourceId) –

    The cluster identifier (ID) for the cluster whose tags you are removing. To find the cluster ID, use DescribeClusters.

  • tag_key_list (TagKeyList) –

    A list of one or more tag keys for the tags that you are removing. Specify only the tag keys, not the tag values.

Raises:

Source code in docs_src/capo_cloudhsm_v2/_services/cloud_hsmv2.py
def untag_resource(
    self,
    resource_id: "capo_cloudhsm_v2.types.resource_id.ResourceId",
    tag_key_list: "capo_cloudhsm_v2.types.tag_key_list.TagKeyList",
    *,
    config_overrides: Optional[CloudHSMV2ClientConfig] = None,
) -> "capo_cloudhsm_v2.types.untag_resource_response.UntagResourceResponse":
    """<p>Removes the specified tag or tags from the specified CloudHSM cluster.</p> <p> <b>Cross-account use:</b> No. You cannot perform this operation on an CloudHSM resource in a different Amazon Web Services account.</p>

    Args:
        resource_id: <p>The cluster identifier (ID) for the cluster whose tags you are removing. To find the cluster ID, use <a>DescribeClusters</a>.</p>
        tag_key_list: <p>A list of one or more tag keys for the tags that you are removing. Specify only the tag keys, not the tag values.</p>

    Raises:
        capo_cloudhsm_v2.errors.cloud_hsm_access_denied_exception.CloudHsmAccessDeniedException: <p>The request was rejected because the requester does not have permission to perform the requested operation.</p>
        capo_cloudhsm_v2.errors.cloud_hsm_internal_failure_exception.CloudHsmInternalFailureException: <p>The request was rejected because of an CloudHSM internal failure. The request can be retried.</p>
        capo_cloudhsm_v2.errors.cloud_hsm_invalid_request_exception.CloudHsmInvalidRequestException: <p>The request was rejected because it is not a valid request.</p>
        capo_cloudhsm_v2.errors.cloud_hsm_resource_not_found_exception.CloudHsmResourceNotFoundException: <p>The request was rejected because it refers to a resource that cannot be found.</p>
        capo_cloudhsm_v2.errors.cloud_hsm_service_exception.CloudHsmServiceException: <p>The request was rejected because an error occurred.</p>
        capo_cloudhsm_v2.errors.cloud_hsm_tag_exception.CloudHsmTagException: <p>The request was rejected because of a tagging failure. Verify the tag conditions in all applicable policies, and then retry the request.</p>
        capo_cloudhsm_v2.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

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

        output, http_response = (
            capo_cloudhsm_v2._operations.baldr_api_service.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_cloudhsm_v2.types.untag_resource_request.UntagResourceRequest = {
        "resource_id": resource_id,
        "tag_key_list": tag_key_list,
    }

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