CreateClusterCommand

Creates a cluster. All nodes in the cluster run the same protocol-compliant engine software.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { MemoryDBClient, CreateClusterCommand } from "@aws-sdk/client-memorydb"; // ES Modules import
// const { MemoryDBClient, CreateClusterCommand } = require("@aws-sdk/client-memorydb"); // CommonJS import
const client = new MemoryDBClient(config);
const input = { // CreateClusterRequest
  ClusterName: "STRING_VALUE", // required
  NodeType: "STRING_VALUE", // required
  MultiRegionClusterName: "STRING_VALUE",
  ParameterGroupName: "STRING_VALUE",
  Description: "STRING_VALUE",
  NumShards: Number("int"),
  NumReplicasPerShard: Number("int"),
  SubnetGroupName: "STRING_VALUE",
  SecurityGroupIds: [ // SecurityGroupIdsList
    "STRING_VALUE",
  ],
  MaintenanceWindow: "STRING_VALUE",
  Port: Number("int"),
  SnsTopicArn: "STRING_VALUE",
  TLSEnabled: true || false,
  KmsKeyId: "STRING_VALUE",
  SnapshotArns: [ // SnapshotArnsList
    "STRING_VALUE",
  ],
  SnapshotName: "STRING_VALUE",
  SnapshotRetentionLimit: Number("int"),
  Tags: [ // TagList
    { // Tag
      Key: "STRING_VALUE",
      Value: "STRING_VALUE",
    },
  ],
  SnapshotWindow: "STRING_VALUE",
  ACLName: "STRING_VALUE", // required
  Engine: "STRING_VALUE",
  EngineVersion: "STRING_VALUE",
  AutoMinorVersionUpgrade: true || false,
  DataTiering: true || false,
};
const command = new CreateClusterCommand(input);
const response = await client.send(command);
// { // CreateClusterResponse
//   Cluster: { // Cluster
//     Name: "STRING_VALUE",
//     Description: "STRING_VALUE",
//     Status: "STRING_VALUE",
//     PendingUpdates: { // ClusterPendingUpdates
//       Resharding: { // ReshardingStatus
//         SlotMigration: { // SlotMigration
//           ProgressPercentage: Number("double"),
//         },
//       },
//       ACLs: { // ACLsUpdateStatus
//         ACLToApply: "STRING_VALUE",
//       },
//       ServiceUpdates: [ // PendingModifiedServiceUpdateList
//         { // PendingModifiedServiceUpdate
//           ServiceUpdateName: "STRING_VALUE",
//           Status: "available" || "in-progress" || "complete" || "scheduled",
//         },
//       ],
//     },
//     MultiRegionClusterName: "STRING_VALUE",
//     NumberOfShards: Number("int"),
//     Shards: [ // ShardList
//       { // Shard
//         Name: "STRING_VALUE",
//         Status: "STRING_VALUE",
//         Slots: "STRING_VALUE",
//         Nodes: [ // NodeList
//           { // Node
//             Name: "STRING_VALUE",
//             Status: "STRING_VALUE",
//             AvailabilityZone: "STRING_VALUE",
//             CreateTime: new Date("TIMESTAMP"),
//             Endpoint: { // Endpoint
//               Address: "STRING_VALUE",
//               Port: Number("int"),
//             },
//           },
//         ],
//         NumberOfNodes: Number("int"),
//       },
//     ],
//     AvailabilityMode: "singleaz" || "multiaz",
//     ClusterEndpoint: {
//       Address: "STRING_VALUE",
//       Port: Number("int"),
//     },
//     NodeType: "STRING_VALUE",
//     Engine: "STRING_VALUE",
//     EngineVersion: "STRING_VALUE",
//     EnginePatchVersion: "STRING_VALUE",
//     ParameterGroupName: "STRING_VALUE",
//     ParameterGroupStatus: "STRING_VALUE",
//     SecurityGroups: [ // SecurityGroupMembershipList
//       { // SecurityGroupMembership
//         SecurityGroupId: "STRING_VALUE",
//         Status: "STRING_VALUE",
//       },
//     ],
//     SubnetGroupName: "STRING_VALUE",
//     TLSEnabled: true || false,
//     KmsKeyId: "STRING_VALUE",
//     ARN: "STRING_VALUE",
//     SnsTopicArn: "STRING_VALUE",
//     SnsTopicStatus: "STRING_VALUE",
//     SnapshotRetentionLimit: Number("int"),
//     MaintenanceWindow: "STRING_VALUE",
//     SnapshotWindow: "STRING_VALUE",
//     ACLName: "STRING_VALUE",
//     AutoMinorVersionUpgrade: true || false,
//     DataTiering: "true" || "false",
//   },
// };

CreateClusterCommand Input

See CreateClusterCommandInput for more details

Parameter
Type
Description
ACLName
Required
string | undefined

The name of the Access Control List to associate with the cluster.

ClusterName
Required
string | undefined

The name of the cluster. This value must be unique as it also serves as the cluster identifier.

NodeType
Required
string | undefined

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

AutoMinorVersionUpgrade
boolean | undefined

When set to true, the cluster will automatically receive minor engine version upgrades after launch.

DataTiering
boolean | undefined

Enables data tiering. Data tiering is only supported for clusters using the r6gd node type. This parameter must be set when using r6gd nodes. For more information, see Data tiering .

Description
string | undefined

An optional description of the cluster.

Engine
string | undefined

The name of the engine to be used for the cluster.

EngineVersion
string | undefined

The version number of the Redis OSS engine to be used for the cluster.

KmsKeyId
string | undefined

The ID of the KMS key used to encrypt the cluster.

MaintenanceWindow
string | undefined

Specifies the weekly time range during which maintenance on the 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:23:00-mon:01:30

MultiRegionClusterName
string | undefined

The name of the multi-Region cluster to be created.

NumReplicasPerShard
number | undefined

The number of replicas to apply to each shard. The default value is 1. The maximum is 5.

NumShards
number | undefined

The number of shards the cluster will contain. The default value is 1.

ParameterGroupName
string | undefined

The name of the parameter group associated with the cluster.

Port
number | undefined

The port number on which each of the nodes accepts connections.

SecurityGroupIds
string[] | undefined

A list of security group names to associate with this cluster.

SnapshotArns
string[] | undefined

A list of Amazon Resource Names (ARN) that uniquely identify the RDB snapshot files stored in Amazon S3. The snapshot files are used to populate the new cluster. The Amazon S3 object name in the ARN cannot contain any commas.

SnapshotName
string | undefined

The name of a snapshot from which to restore data into the new cluster. The snapshot status changes to restoring while the new cluster is being created.

SnapshotRetentionLimit
number | undefined

The number of days for which MemoryDB retains automatic snapshots before deleting them. For example, if you set SnapshotRetentionLimit to 5, a snapshot that was taken today is retained for 5 days before being deleted.

SnapshotWindow
string | undefined

The daily time range (in UTC) during which MemoryDB begins taking a daily snapshot of your shard.

Example: 05:00-09:00

If you do not specify this parameter, MemoryDB automatically chooses an appropriate time range.

SnsTopicArn
string | undefined

The Amazon Resource Name (ARN) of the Amazon Simple Notification Service (SNS) topic to which notifications are sent.

SubnetGroupName
string | undefined

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

TLSEnabled
boolean | undefined

A flag to enable in-transit encryption on the cluster.

Tags
Tag[] | undefined

A list of tags to be added to this resource. Tags are comma-separated key,value pairs (e.g. Key=myKey, Value=myKeyValue. You can include multiple tags as shown following: Key=myKey, Value=myKeyValue Key=mySecondKey, Value=mySecondKeyValue.

CreateClusterCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
Cluster
Cluster | undefined

The newly-created cluster.