Skip to content

create_cluster async

create_cluster(
    *,
    config_overrides: Optional[AsyncRoute53RecoveryControlConfigClientConfig] = None,
    client_token: Optional[__stringMin1Max64PatternS] = None,
    cluster_name: Optional[__stringMin1Max64PatternS] = None,
    tags: Optional[__mapOf__stringMin0Max256PatternS] = None,
    network_type: Optional[NetworkType] = None,
) -> CreateClusterResponse

Create a new cluster. A cluster is a set of redundant Regional endpoints against which you can run API calls to update or get the state of one or more routing controls. Each cluster has a name, status, Amazon Resource Name (ARN), and an array of the five cluster endpoints (one for each supported Amazon Web Services Region) that you can use with API calls to the cluster data plane.

Parameters:

Raises:

  • AccessDeniedException –

    403 response - You do not have sufficient access to perform this action.

  • ConflictException –

    409 response - ConflictException. You might be using a predefined variable.

  • InternalServerException –

    500 response - InternalServiceError. Temporary service error. Retry the request.

  • ResourceNotFoundException –

    404 response - MalformedQueryString. The query string contains a syntax error or resource not found.

  • ServiceQuotaExceededException –

    402 response - You attempted to create more resources than the service allows based on service quotas.

  • ThrottlingException –

    429 response - LimitExceededException or TooManyRequestsException.

  • ValidationException –

    400 response - Multiple causes. For example, you might have a malformed query string and input parameter might be out of range, or you might have used parameters together incorrectly.

  • UnknownServiceError –

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

Source code in docs_src/capo_route53_recovery_control_config/_services/async_route53_recovery_control_config.py
async def create_cluster(
    self,
    *,
    config_overrides: Optional[
        AsyncRoute53RecoveryControlConfigClientConfig
    ] = None,
    client_token: Optional[
        "capo_route53_recovery_control_config.types.__string_min1_max64_pattern_s.__stringMin1Max64PatternS"
    ] = None,
    cluster_name: Optional[
        "capo_route53_recovery_control_config.types.__string_min1_max64_pattern_s.__stringMin1Max64PatternS"
    ] = None,
    tags: Optional[
        "capo_route53_recovery_control_config.types.__map_of__string_min0_max256_pattern_s.__mapOf__stringMin0Max256PatternS"
    ] = None,
    network_type: Optional[
        "capo_route53_recovery_control_config.types.network_type.NetworkType"
    ] = None,
) -> "capo_route53_recovery_control_config.types.create_cluster_response.CreateClusterResponse":
    """<p>Create a new cluster. A cluster is a set of redundant Regional endpoints against which you can run API calls to update or get the state of one or more routing controls. Each cluster has a name, status, Amazon Resource Name (ARN), and an array of the five cluster endpoints (one for each supported Amazon Web Services Region) that you can use with API calls to the cluster data plane.</p>

    Args:
        client_token: <p>A unique, case-sensitive string of up to 64 ASCII characters. To make an idempotent API request with an action, specify a client token in the request.</p>
        cluster_name: <p>The name of the cluster.</p>
        tags: <p>The tags associated with the cluster.</p>
        network_type: <p>The network type of the cluster. NetworkType can be one of the following: IPV4, DUALSTACK.</p>

    Raises:
        capo_route53_recovery_control_config.errors.access_denied_exception.AccessDeniedException: <p>403 response - You do not have sufficient access to perform this action.</p>
        capo_route53_recovery_control_config.errors.conflict_exception.ConflictException: <p>409 response - ConflictException. You might be using a predefined variable.</p>
        capo_route53_recovery_control_config.errors.internal_server_exception.InternalServerException: <p>500 response - InternalServiceError. Temporary service error. Retry the request.</p>
        capo_route53_recovery_control_config.errors.resource_not_found_exception.ResourceNotFoundException: <p>404 response - MalformedQueryString. The query string contains a syntax error or resource not found.</p>
        capo_route53_recovery_control_config.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>402 response - You attempted to create more resources than the service allows based on service quotas.</p>
        capo_route53_recovery_control_config.errors.throttling_exception.ThrottlingException: <p>429 response - LimitExceededException or TooManyRequestsException.</p>
        capo_route53_recovery_control_config.errors.validation_exception.ValidationException: <p>400 response - Multiple causes. For example, you might have a malformed query string and input parameter might be out of range, or you might have used parameters together incorrectly.</p>
        capo_route53_recovery_control_config.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_route53_recovery_control_config.types.create_cluster_request.CreateClusterRequest]",
    ) -> AsyncOperationResponse[
        "capo_route53_recovery_control_config.types.create_cluster_response.CreateClusterResponse"
    ]:
        import capo_route53_recovery_control_config._operations.route53_recovery_control_config.create_cluster

        (
            output,
            http_response,
        ) = await capo_route53_recovery_control_config._operations.route53_recovery_control_config.create_cluster.async_create_cluster(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateCluster")
    )
    input_: capo_route53_recovery_control_config.types.create_cluster_request.CreateClusterRequest = {}
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token
    if cluster_name is not None:
        input_["cluster_name"] = cluster_name
    if tags is not None:
        input_["tags"] = tags
    if network_type is not None:
        input_["network_type"] = network_type

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