Skip to content

create_multi_region_cluster

create_multi_region_cluster(
    multi_region_cluster_name_suffix: String,
    node_type: String,
    *,
    config_overrides: Optional[MemoryDBClientConfig] = None,
    description: Optional[String] = None,
    engine: Optional[String] = None,
    engine_version: Optional[String] = None,
    multi_region_parameter_group_name: Optional[String] = None,
    num_shards: Optional[IntegerOptional] = None,
    tls_enabled: Optional[BooleanOptional] = None,
    tags: Optional[TagList] = None,
) -> CreateMultiRegionClusterResponse

Creates a new multi-Region cluster.

Parameters:

  • multi_region_cluster_name_suffix (String) –

    A suffix to be added to the Multi-Region cluster name. Amazon MemoryDB automatically applies a prefix to the Multi-Region cluster Name when it is created. Each Amazon Region has its own prefix. For instance, a Multi-Region cluster Name created in the US-West-1 region will begin with "virxk", along with the suffix name you provide. The suffix guarantees uniqueness of the Multi-Region cluster name across multiple regions.

  • description (Optional[String], default: None ) –

    A description for the multi-Region cluster.

  • engine (Optional[String], default: None ) –

    The name of the engine to be used for the multi-Region cluster.

  • engine_version (Optional[String], default: None ) –

    The version of the engine to be used for the multi-Region cluster.

  • node_type (String) –

    The node type to be used for the multi-Region cluster.

  • multi_region_parameter_group_name (Optional[String], default: None ) –

    The name of the multi-Region parameter group to be associated with the cluster.

  • num_shards (Optional[IntegerOptional], default: None ) –

    The number of shards for the multi-Region cluster.

  • tls_enabled (Optional[BooleanOptional], default: None ) –

    Whether to enable TLS encryption for the multi-Region cluster.

  • tags (Optional[TagList], default: None ) –

    A list of tags to be applied to the multi-Region cluster.

Raises:

Source code in docs_src/capo_memorydb/_services/memory_db.py
def create_multi_region_cluster(
    self,
    multi_region_cluster_name_suffix: "capo_memorydb.types.string.String",
    node_type: "capo_memorydb.types.string.String",
    *,
    config_overrides: Optional[MemoryDBClientConfig] = None,
    description: Optional["capo_memorydb.types.string.String"] = None,
    engine: Optional["capo_memorydb.types.string.String"] = None,
    engine_version: Optional["capo_memorydb.types.string.String"] = None,
    multi_region_parameter_group_name: Optional[
        "capo_memorydb.types.string.String"
    ] = None,
    num_shards: Optional[
        "capo_memorydb.types.integer_optional.IntegerOptional"
    ] = None,
    tls_enabled: Optional[
        "capo_memorydb.types.boolean_optional.BooleanOptional"
    ] = None,
    tags: Optional["capo_memorydb.types.tag_list.TagList"] = None,
) -> "capo_memorydb.types.create_multi_region_cluster_response.CreateMultiRegionClusterResponse":
    """<p>Creates a new multi-Region cluster.</p>

    Args:
        multi_region_cluster_name_suffix: <p>A suffix to be added to the Multi-Region cluster name. Amazon MemoryDB automatically applies a prefix to the Multi-Region cluster Name when it is created. Each Amazon Region has its own prefix. For instance, a Multi-Region cluster Name created in the US-West-1 region will begin with "virxk", along with the suffix name you provide. The suffix guarantees uniqueness of the Multi-Region cluster name across multiple regions.</p>
        description: <p>A description for the multi-Region cluster.</p>
        engine: <p>The name of the engine to be used for the multi-Region cluster.</p>
        engine_version: <p>The version of the engine to be used for the multi-Region cluster.</p>
        node_type: <p>The node type to be used for the multi-Region cluster.</p>
        multi_region_parameter_group_name: <p>The name of the multi-Region parameter group to be associated with the cluster.</p>
        num_shards: <p>The number of shards for the multi-Region cluster.</p>
        tls_enabled: <p>Whether to enable TLS encryption for the multi-Region cluster.</p>
        tags: <p>A list of tags to be applied to the multi-Region cluster.</p>

    Raises:
        capo_memorydb.errors.cluster_quota_for_customer_exceeded_fault.ClusterQuotaForCustomerExceededFault: <p>The request cannot be processed because it would exceed the maximum number of clusters allowed for this customer.</p>
        capo_memorydb.errors.invalid_parameter_combination_exception.InvalidParameterCombinationException: <p>The specified parameter combination is not valid.</p>
        capo_memorydb.errors.invalid_parameter_value_exception.InvalidParameterValueException: <p>The specified parameter value is not valid.</p>
        capo_memorydb.errors.multi_region_cluster_already_exists_fault.MultiRegionClusterAlreadyExistsFault: <p>A multi-Region cluster with the specified name already exists.</p>
        capo_memorydb.errors.multi_region_parameter_group_not_found_fault.MultiRegionParameterGroupNotFoundFault: <p>The specified multi-Region parameter group does not exist.</p>
        capo_memorydb.errors.tag_quota_per_resource_exceeded.TagQuotaPerResourceExceeded: <p>The request cannot be processed because it would exceed the maximum number of tags allowed per resource.</p>
        capo_memorydb.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_memorydb.types.create_multi_region_cluster_request.CreateMultiRegionClusterRequest]",
    ) -> OperationResponse[
        "capo_memorydb.types.create_multi_region_cluster_response.CreateMultiRegionClusterResponse"
    ]:
        import capo_memorydb._operations.amazon_memory_db.create_multi_region_cluster

        output, http_response = (
            capo_memorydb._operations.amazon_memory_db.create_multi_region_cluster.create_multi_region_cluster(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateMultiRegionCluster")
    )
    input_: capo_memorydb.types.create_multi_region_cluster_request.CreateMultiRegionClusterRequest = {
        "multi_region_cluster_name_suffix": multi_region_cluster_name_suffix,
        "node_type": node_type,
    }
    if description is not None:
        input_["description"] = description
    if engine is not None:
        input_["engine"] = engine
    if engine_version is not None:
        input_["engine_version"] = engine_version
    if multi_region_parameter_group_name is not None:
        input_["multi_region_parameter_group_name"] = (
            multi_region_parameter_group_name
        )
    if num_shards is not None:
        input_["num_shards"] = num_shards
    if tls_enabled is not None:
        input_["tls_enabled"] = tls_enabled
    if tags is not None:
        input_["tags"] = tags

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