CreateGlobalClusterCommand

Creates an Amazon DocumentDB global cluster that can span multiple multiple Amazon Web Services Regions. The global cluster contains one primary cluster with read-write capability, and up-to give read-only secondary clusters. Global clusters uses storage-based fast replication across regions with latencies less than one second, using dedicated infrastructure with no impact to your workload’s performance.

You can create a global cluster that is initially empty, and then add a primary and a secondary to it. Or you can specify an existing cluster during the create operation, and this cluster becomes the primary of the global cluster.

This action only applies to Amazon DocumentDB clusters.

Example Syntax

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

import { DocDBClient, CreateGlobalClusterCommand } from "@aws-sdk/client-docdb"; // ES Modules import
// const { DocDBClient, CreateGlobalClusterCommand } = require("@aws-sdk/client-docdb"); // CommonJS import
const client = new DocDBClient(config);
const input = { // CreateGlobalClusterMessage
  GlobalClusterIdentifier: "STRING_VALUE", // required
  SourceDBClusterIdentifier: "STRING_VALUE",
  Engine: "STRING_VALUE",
  EngineVersion: "STRING_VALUE",
  DeletionProtection: true || false,
  DatabaseName: "STRING_VALUE",
  StorageEncrypted: true || false,
};
const command = new CreateGlobalClusterCommand(input);
const response = await client.send(command);
// { // CreateGlobalClusterResult
//   GlobalCluster: { // GlobalCluster
//     GlobalClusterIdentifier: "STRING_VALUE",
//     GlobalClusterResourceId: "STRING_VALUE",
//     GlobalClusterArn: "STRING_VALUE",
//     Status: "STRING_VALUE",
//     Engine: "STRING_VALUE",
//     EngineVersion: "STRING_VALUE",
//     DatabaseName: "STRING_VALUE",
//     StorageEncrypted: true || false,
//     DeletionProtection: true || false,
//     GlobalClusterMembers: [ // GlobalClusterMemberList
//       { // GlobalClusterMember
//         DBClusterArn: "STRING_VALUE",
//         Readers: [ // ReadersArnList
//           "STRING_VALUE",
//         ],
//         IsWriter: true || false,
//       },
//     ],
//   },
// };

CreateGlobalClusterCommand Input

See CreateGlobalClusterCommandInput for more details

Parameter
Type
Description
GlobalClusterIdentifier
Required
string | undefined

The cluster identifier of the new global cluster.

DatabaseName
string | undefined

The name for your database of up to 64 alpha-numeric characters. If you do not provide a name, Amazon DocumentDB will not create a database in the global cluster you are creating.

DeletionProtection
boolean | undefined

The deletion protection setting for the new global cluster. The global cluster can't be deleted when deletion protection is enabled.

Engine
string | undefined

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

EngineVersion
string | undefined

The engine version of the global cluster.

SourceDBClusterIdentifier
string | undefined

The Amazon Resource Name (ARN) to use as the primary cluster of the global cluster. This parameter is optional.

StorageEncrypted
boolean | undefined

The storage encryption setting for the new global cluster.

CreateGlobalClusterCommand Output

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

A data type representing an Amazon DocumentDB global cluster.

Throws

Name
Fault
Details
DBClusterNotFoundFault
client

DBClusterIdentifier doesn't refer to an existing cluster.

GlobalClusterAlreadyExistsFault
client

The GlobalClusterIdentifier already exists. Choose a new global cluster identifier (unique name) to create a new global cluster.

GlobalClusterQuotaExceededFault
client

The number of global clusters for this account is already at the maximum allowed.

InvalidDBClusterStateFault
client

The cluster isn't in a valid state.

DocDBServiceException
Base exception class for all service exceptions from DocDB service.