Skip to content

create_cluster

create_cluster(
    cluster_name: String,
    node_type: String,
    replication_factor: Integer,
    iam_role_arn: String,
    *,
    config_overrides: Optional[DAXClientConfig] = None,
    description: Optional[String] = None,
    availability_zones: Optional[AvailabilityZoneList] = None,
    subnet_group_name: Optional[String] = None,
    security_group_ids: Optional[SecurityGroupIdentifierList] = None,
    preferred_maintenance_window: Optional[String] = None,
    notification_topic_arn: Optional[String] = None,
    parameter_group_name: Optional[String] = None,
    tags: Optional[TagList] = None,
    sse_specification: Optional[SSESpecification] = None,
    cluster_endpoint_encryption_type: Optional[ClusterEndpointEncryptionType] = None,
    network_type: Optional[NetworkType] = None,
) -> CreateClusterResponse

Creates a DAX cluster. All nodes in the cluster run the same DAX caching software.

Parameters:

  • cluster_name (String) –

    The cluster identifier. This parameter is stored as a lowercase string.

    Constraints:

    • A name must contain from 1 to 20 alphanumeric characters or hyphens.

    • The first character must be a letter.

    • A name cannot end with a hyphen or contain two consecutive hyphens.

  • node_type (String) –

    The compute and memory capacity of the nodes in the cluster.

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

    A description of the cluster.

  • replication_factor (Integer) –

    The number of nodes in the DAX cluster. A replication factor of 1 will create a single-node cluster, without any read replicas. For additional fault tolerance, you can create a multiple node cluster with one or more read replicas. To do this, set ReplicationFactor to a number between 3 (one primary and two read replicas) and 10 (one primary and nine read replicas). If the AvailabilityZones parameter is provided, its length must equal the ReplicationFactor.

    Amazon Web Services recommends that you have at least two read replicas per cluster.

  • availability_zones (Optional[AvailabilityZoneList], default: None ) –

    The Availability Zones (AZs) in which the cluster nodes will reside after the cluster has been created or updated. If provided, the length of this list must equal the ReplicationFactor parameter. If you omit this parameter, DAX will spread the nodes across Availability Zones for the highest availability.

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

    The name of the subnet group to be used for the replication group.

    DAX clusters can only run in an Amazon VPC environment. All of the subnets that you specify in a subnet group must exist in the same VPC.

  • security_group_ids (Optional[SecurityGroupIdentifierList], default: None ) –

    A list of security group IDs to be assigned to each node in the DAX cluster. (Each of the security group ID is system-generated.)

    If this parameter is not specified, DAX assigns the default VPC security group to each node.

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

    Specifies the weekly time range during which maintenance on the DAX cluster is performed. It is specified as a range in the format ddd:hh24:mi-ddd:hh24:mi (24H Clock UTC). The minimum maintenance window is a 60 minute period. Valid values for ddd are:

    • sun

    • mon

    • tue

    • wed

    • thu

    • fri

    • sat

    Example: sun:05:00-sun:09:00

    If you don't specify a preferred maintenance window when you create or modify a cache cluster, DAX assigns a 60-minute maintenance window on a randomly selected day of the week.

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

    The Amazon Resource Name (ARN) of the Amazon SNS topic to which notifications will be sent.

    The Amazon SNS topic owner must be same as the DAX cluster owner.

  • iam_role_arn (String) –

    A valid Amazon Resource Name (ARN) that identifies an IAM role. At runtime, DAX will assume this role and use the role's permissions to access DynamoDB on your behalf.

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

    The parameter group to be associated with the DAX cluster.

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

    A set of tags to associate with the DAX cluster.

  • sse_specification (Optional[SSESpecification], default: None ) –

    Represents the settings used to enable server-side encryption on the cluster.

  • cluster_endpoint_encryption_type (Optional[ClusterEndpointEncryptionType], default: None ) –

    The type of encryption the cluster's endpoint should support. Values are:

    • NONE for no encryption

    • TLS for Transport Layer Security

  • network_type (Optional[NetworkType], default: None ) –

    Specifies the IP protocol(s) the cluster uses for network communications. Values are:

    • ipv4 - The cluster is accessible only through IPv4 addresses

    • ipv6 - The cluster is accessible only through IPv6 addresses

    • dual_stack - The cluster is accessible through both IPv4 and IPv6 addresses.

    If no explicit NetworkType is provided, the network type is derived based on the subnet group's configuration.

Raises:

Source code in docs_src/capo_dax/_services/dax.py
def create_cluster(
    self,
    cluster_name: "capo_dax.types.string.String",
    node_type: "capo_dax.types.string.String",
    replication_factor: "capo_dax.types.integer.Integer",
    iam_role_arn: "capo_dax.types.string.String",
    *,
    config_overrides: Optional[DAXClientConfig] = None,
    description: Optional["capo_dax.types.string.String"] = None,
    availability_zones: Optional[
        "capo_dax.types.availability_zone_list.AvailabilityZoneList"
    ] = None,
    subnet_group_name: Optional["capo_dax.types.string.String"] = None,
    security_group_ids: Optional[
        "capo_dax.types.security_group_identifier_list.SecurityGroupIdentifierList"
    ] = None,
    preferred_maintenance_window: Optional["capo_dax.types.string.String"] = None,
    notification_topic_arn: Optional["capo_dax.types.string.String"] = None,
    parameter_group_name: Optional["capo_dax.types.string.String"] = None,
    tags: Optional["capo_dax.types.tag_list.TagList"] = None,
    sse_specification: Optional[
        "capo_dax.types.sse_specification.SSESpecification"
    ] = None,
    cluster_endpoint_encryption_type: Optional[
        "capo_dax.types.cluster_endpoint_encryption_type.ClusterEndpointEncryptionType"
    ] = None,
    network_type: Optional["capo_dax.types.network_type.NetworkType"] = None,
) -> "capo_dax.types.create_cluster_response.CreateClusterResponse":
    """<p>Creates a DAX cluster. All nodes in the cluster run the same DAX caching software.</p>

    Args:
        cluster_name: <p>The cluster identifier. This parameter is stored as a lowercase string.</p> <p> <b>Constraints:</b> </p> <ul> <li> <p>A name must contain from 1 to 20 alphanumeric characters or hyphens.</p> </li> <li> <p>The first character must be a letter.</p> </li> <li> <p>A name cannot end with a hyphen or contain two consecutive hyphens.</p> </li> </ul>
        node_type: <p>The compute and memory capacity of the nodes in the cluster.</p>
        description: <p>A description of the cluster.</p>
        replication_factor: <p>The number of nodes in the DAX cluster. A replication factor of 1 will create a single-node cluster, without any read replicas. For additional fault tolerance, you can create a multiple node cluster with one or more read replicas. To do this, set <code>ReplicationFactor</code> to a number between 3 (one primary and two read replicas) and 10 (one primary and nine read replicas). <code>If the AvailabilityZones</code> parameter is provided, its length must equal the <code>ReplicationFactor</code>.</p> <note> <p>Amazon Web Services recommends that you have at least two read replicas per cluster.</p> </note>
        availability_zones: <p>The Availability Zones (AZs) in which the cluster nodes will reside after the cluster has been created or updated. If provided, the length of this list must equal the <code>ReplicationFactor</code> parameter. If you omit this parameter, DAX will spread the nodes across Availability Zones for the highest availability.</p>
        subnet_group_name: <p>The name of the subnet group to be used for the replication group.</p> <important> <p>DAX clusters can only run in an Amazon VPC environment. All of the subnets that you specify in a subnet group must exist in the same VPC.</p> </important>
        security_group_ids: <p>A list of security group IDs to be assigned to each node in the DAX cluster. (Each of the security group ID is system-generated.)</p> <p>If this parameter is not specified, DAX assigns the default VPC security group to each node.</p>
        preferred_maintenance_window: <p>Specifies the weekly time range during which maintenance on the DAX cluster is performed. It is specified as a range in the format ddd:hh24:mi-ddd:hh24:mi (24H Clock UTC). The minimum maintenance window is a 60 minute period. Valid values for <code>ddd</code> are:</p> <ul> <li> <p> <code>sun</code> </p> </li> <li> <p> <code>mon</code> </p> </li> <li> <p> <code>tue</code> </p> </li> <li> <p> <code>wed</code> </p> </li> <li> <p> <code>thu</code> </p> </li> <li> <p> <code>fri</code> </p> </li> <li> <p> <code>sat</code> </p> </li> </ul> <p>Example: <code>sun:05:00-sun:09:00</code> </p> <note> <p>If you don't specify a preferred maintenance window when you create or modify a cache cluster, DAX assigns a 60-minute maintenance window on a randomly selected day of the week.</p> </note>
        notification_topic_arn: <p>The Amazon Resource Name (ARN) of the Amazon SNS topic to which notifications will be sent.</p> <note> <p>The Amazon SNS topic owner must be same as the DAX cluster owner.</p> </note>
        iam_role_arn: <p>A valid Amazon Resource Name (ARN) that identifies an IAM role. At runtime, DAX will assume this role and use the role's permissions to access DynamoDB on your behalf.</p>
        parameter_group_name: <p>The parameter group to be associated with the DAX cluster.</p>
        tags: <p>A set of tags to associate with the DAX cluster. </p>
        sse_specification: <p>Represents the settings used to enable server-side encryption on the cluster.</p>
        cluster_endpoint_encryption_type: <p>The type of encryption the cluster's endpoint should support. Values are:</p> <ul> <li> <p> <code>NONE</code> for no encryption</p> </li> <li> <p> <code>TLS</code> for Transport Layer Security</p> </li> </ul>
        network_type: <p>Specifies the IP protocol(s) the cluster uses for network communications. Values are:</p> <ul> <li> <p> <code>ipv4</code> - The cluster is accessible only through IPv4 addresses</p> </li> <li> <p> <code>ipv6</code> - The cluster is accessible only through IPv6 addresses</p> </li> <li> <p> <code>dual_stack</code> - The cluster is accessible through both IPv4 and IPv6 addresses.</p> </li> </ul> <note> <p>If no explicit <code>NetworkType</code> is provided, the network type is derived based on the subnet group's configuration.</p> </note>

    Raises:
        capo_dax.errors.cluster_already_exists_fault.ClusterAlreadyExistsFault: <p>You already have a DAX cluster with the given identifier.</p>
        capo_dax.errors.cluster_quota_for_customer_exceeded_fault.ClusterQuotaForCustomerExceededFault: <p>You have attempted to exceed the maximum number of DAX clusters for your Amazon Web Services account.</p>
        capo_dax.errors.insufficient_cluster_capacity_fault.InsufficientClusterCapacityFault: <p>There are not enough system resources to create the cluster you requested (or to resize an already-existing cluster). </p>
        capo_dax.errors.invalid_cluster_state_fault.InvalidClusterStateFault: <p>The requested DAX cluster is not in the <i>available</i> state.</p>
        capo_dax.errors.invalid_parameter_combination_exception.InvalidParameterCombinationException: <p>Two or more incompatible parameters were specified.</p>
        capo_dax.errors.invalid_parameter_group_state_fault.InvalidParameterGroupStateFault: <p>One or more parameters in a parameter group are in an invalid state.</p>
        capo_dax.errors.invalid_parameter_value_exception.InvalidParameterValueException: <p>The value for a parameter is invalid.</p>
        capo_dax.errors.invalid_vpc_network_state_fault.InvalidVPCNetworkStateFault: <p>The VPC network is in an invalid state.</p>
        capo_dax.errors.node_quota_for_cluster_exceeded_fault.NodeQuotaForClusterExceededFault: <p>You have attempted to exceed the maximum number of nodes for a DAX cluster.</p>
        capo_dax.errors.node_quota_for_customer_exceeded_fault.NodeQuotaForCustomerExceededFault: <p>You have attempted to exceed the maximum number of nodes for your Amazon Web Services account.</p>
        capo_dax.errors.parameter_group_not_found_fault.ParameterGroupNotFoundFault: <p>The specified parameter group does not exist.</p>
        capo_dax.errors.service_linked_role_not_found_fault.ServiceLinkedRoleNotFoundFault: <p>The specified service linked role (SLR) was not found.</p>
        capo_dax.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>You have reached the maximum number of x509 certificates that can be created for encrypted clusters in a 30 day period. Contact Amazon Web Services customer support to discuss options for continuing to create encrypted clusters.</p>
        capo_dax.errors.subnet_group_not_found_fault.SubnetGroupNotFoundFault: <p>The requested subnet group name does not refer to an existing subnet group.</p>
        capo_dax.errors.tag_quota_per_resource_exceeded.TagQuotaPerResourceExceeded: <p>You have exceeded the maximum number of tags for this DAX cluster.</p>
        capo_dax.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_dax.types.create_cluster_request.CreateClusterRequest]",
    ) -> OperationResponse[
        "capo_dax.types.create_cluster_response.CreateClusterResponse"
    ]:
        import capo_dax._operations.amazon_daxv3.create_cluster

        output, http_response = (
            capo_dax._operations.amazon_daxv3.create_cluster.create_cluster(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateCluster")
    )
    input_: capo_dax.types.create_cluster_request.CreateClusterRequest = {
        "cluster_name": cluster_name,
        "node_type": node_type,
        "replication_factor": replication_factor,
        "iam_role_arn": iam_role_arn,
    }
    if description is not None:
        input_["description"] = description
    if availability_zones is not None:
        input_["availability_zones"] = availability_zones
    if subnet_group_name is not None:
        input_["subnet_group_name"] = subnet_group_name
    if security_group_ids is not None:
        input_["security_group_ids"] = security_group_ids
    if preferred_maintenance_window is not None:
        input_["preferred_maintenance_window"] = preferred_maintenance_window
    if notification_topic_arn is not None:
        input_["notification_topic_arn"] = notification_topic_arn
    if parameter_group_name is not None:
        input_["parameter_group_name"] = parameter_group_name
    if tags is not None:
        input_["tags"] = tags
    if sse_specification is not None:
        input_["sse_specification"] = sse_specification
    if cluster_endpoint_encryption_type is not None:
        input_["cluster_endpoint_encryption_type"] = (
            cluster_endpoint_encryption_type
        )
    if network_type is not None:
        input_["network_type"] = network_type

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