CreateDBClusterSnapshotCommand

Creates a snapshot of a cluster.

Example Syntax

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

import { DocDBClient, CreateDBClusterSnapshotCommand } from "@aws-sdk/client-docdb"; // ES Modules import
// const { DocDBClient, CreateDBClusterSnapshotCommand } = require("@aws-sdk/client-docdb"); // CommonJS import
const client = new DocDBClient(config);
const input = { // CreateDBClusterSnapshotMessage
  DBClusterSnapshotIdentifier: "STRING_VALUE", // required
  DBClusterIdentifier: "STRING_VALUE", // required
  Tags: [ // TagList
    { // Tag
      Key: "STRING_VALUE",
      Value: "STRING_VALUE",
    },
  ],
};
const command = new CreateDBClusterSnapshotCommand(input);
const response = await client.send(command);
// { // CreateDBClusterSnapshotResult
//   DBClusterSnapshot: { // DBClusterSnapshot
//     AvailabilityZones: [ // AvailabilityZones
//       "STRING_VALUE",
//     ],
//     DBClusterSnapshotIdentifier: "STRING_VALUE",
//     DBClusterIdentifier: "STRING_VALUE",
//     SnapshotCreateTime: new Date("TIMESTAMP"),
//     Engine: "STRING_VALUE",
//     Status: "STRING_VALUE",
//     Port: Number("int"),
//     VpcId: "STRING_VALUE",
//     ClusterCreateTime: new Date("TIMESTAMP"),
//     MasterUsername: "STRING_VALUE",
//     EngineVersion: "STRING_VALUE",
//     SnapshotType: "STRING_VALUE",
//     PercentProgress: Number("int"),
//     StorageEncrypted: true || false,
//     KmsKeyId: "STRING_VALUE",
//     DBClusterSnapshotArn: "STRING_VALUE",
//     SourceDBClusterSnapshotArn: "STRING_VALUE",
//     StorageType: "STRING_VALUE",
//   },
// };

CreateDBClusterSnapshotCommand Input

Parameter
Type
Description
DBClusterIdentifier
Required
string | undefined

The identifier of the cluster to create a snapshot for. This parameter is not case sensitive.

Constraints:

  • Must match the identifier of an existing DBCluster.

Example: my-cluster

DBClusterSnapshotIdentifier
Required
string | undefined

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

Constraints:

  • Must contain from 1 to 63 letters, numbers, or hyphens.

  • The first character must be a letter.

  • Cannot end with a hyphen or contain two consecutive hyphens.

Example: my-cluster-snapshot1

Tags
Tag[] | undefined

The tags to be assigned to the cluster snapshot.

CreateDBClusterSnapshotCommand Output

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

Detailed information about a cluster snapshot.

Throws

Name
Fault
Details
DBClusterNotFoundFault
client

DBClusterIdentifier doesn't refer to an existing cluster.

DBClusterSnapshotAlreadyExistsFault
client

You already have a cluster snapshot with the given identifier.

InvalidDBClusterSnapshotStateFault
client

The provided value isn't a valid cluster snapshot state.

InvalidDBClusterStateFault
client

The cluster isn't in a valid state.

SnapshotQuotaExceededFault
client

The request would cause you to exceed the allowed number of snapshots.

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