Skip to content

delete_cluster async

delete_cluster(
    cluster_id: ClusterId,
    *,
    config_overrides: Optional[AsyncCloudHSMV2ClientConfig] = None,
) -> DeleteClusterResponse

Deletes the specified CloudHSM cluster. Before you can delete a cluster, you must delete all HSMs in the cluster. To see if the cluster contains any HSMs, use DescribeClusters. To delete an HSM, use DeleteHsm.

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

Parameters:

  • cluster_id (ClusterId) –

    The identifier (ID) of the cluster that you are deleting. To find the cluster ID, use DescribeClusters.

Raises:

Source code in docs_src/capo_cloudhsm_v2/_services/async_cloud_hsmv2.py
async def delete_cluster(
    self,
    cluster_id: "capo_cloudhsm_v2.types.cluster_id.ClusterId",
    *,
    config_overrides: Optional[AsyncCloudHSMV2ClientConfig] = None,
) -> "capo_cloudhsm_v2.types.delete_cluster_response.DeleteClusterResponse":
    """<p>Deletes the specified CloudHSM cluster. Before you can delete a cluster, you must delete all HSMs in the cluster. To see if the cluster contains any HSMs, use <a>DescribeClusters</a>. To delete an HSM, use <a>DeleteHsm</a>.</p> <p> <b>Cross-account use:</b> No. You cannot perform this operation on an CloudHSM cluster in a different Amazon Web Services account.</p>

    Args:
        cluster_id: <p>The identifier (ID) of the cluster that you are deleting. To find the cluster ID, use <a>DescribeClusters</a>.</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.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_cloudhsm_v2.types.delete_cluster_request.DeleteClusterRequest]",
    ) -> AsyncOperationResponse[
        "capo_cloudhsm_v2.types.delete_cluster_response.DeleteClusterResponse"
    ]:
        import capo_cloudhsm_v2._operations.baldr_api_service.delete_cluster

        (
            output,
            http_response,
        ) = await capo_cloudhsm_v2._operations.baldr_api_service.delete_cluster.async_delete_cluster(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteCluster")
    )
    input_: capo_cloudhsm_v2.types.delete_cluster_request.DeleteClusterRequest = {
        "cluster_id": cluster_id
    }

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