- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
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 |
---|
Parameter | Type | Description |
---|---|---|
DBClusterIdentifier Required | string | undefined | The identifier of the cluster to create a snapshot for. This parameter is not case sensitive. Constraints:
Example: |
DBClusterSnapshotIdentifier Required | string | undefined | The identifier of the cluster snapshot. This parameter is stored as a lowercase string. Constraints:
Example: |
Tags | Tag[] | undefined | The tags to be assigned to the cluster snapshot. |
CreateDBClusterSnapshotCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
DBClusterSnapshot | DBClusterSnapshot | undefined | Detailed information about a cluster snapshot. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
DBClusterNotFoundFault | client | |
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. |