- 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.
CreateSnapshotCommand
Creates a copy of an entire cluster at a specific moment in time.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { MemoryDBClient, CreateSnapshotCommand } from "@aws-sdk/client-memorydb"; // ES Modules import
// const { MemoryDBClient, CreateSnapshotCommand } = require("@aws-sdk/client-memorydb"); // CommonJS import
const client = new MemoryDBClient(config);
const input = { // CreateSnapshotRequest
ClusterName: "STRING_VALUE", // required
SnapshotName: "STRING_VALUE", // required
KmsKeyId: "STRING_VALUE",
Tags: [ // TagList
{ // Tag
Key: "STRING_VALUE",
Value: "STRING_VALUE",
},
],
};
const command = new CreateSnapshotCommand(input);
const response = await client.send(command);
// { // CreateSnapshotResponse
// Snapshot: { // Snapshot
// Name: "STRING_VALUE",
// Status: "STRING_VALUE",
// Source: "STRING_VALUE",
// KmsKeyId: "STRING_VALUE",
// ARN: "STRING_VALUE",
// ClusterConfiguration: { // ClusterConfiguration
// Name: "STRING_VALUE",
// Description: "STRING_VALUE",
// NodeType: "STRING_VALUE",
// Engine: "STRING_VALUE",
// EngineVersion: "STRING_VALUE",
// MaintenanceWindow: "STRING_VALUE",
// TopicArn: "STRING_VALUE",
// Port: Number("int"),
// ParameterGroupName: "STRING_VALUE",
// SubnetGroupName: "STRING_VALUE",
// VpcId: "STRING_VALUE",
// SnapshotRetentionLimit: Number("int"),
// SnapshotWindow: "STRING_VALUE",
// NumShards: Number("int"),
// Shards: [ // ShardDetails
// { // ShardDetail
// Name: "STRING_VALUE",
// Configuration: { // ShardConfiguration
// Slots: "STRING_VALUE",
// ReplicaCount: Number("int"),
// },
// Size: "STRING_VALUE",
// SnapshotCreationTime: new Date("TIMESTAMP"),
// },
// ],
// MultiRegionParameterGroupName: "STRING_VALUE",
// MultiRegionClusterName: "STRING_VALUE",
// },
// DataTiering: "true" || "false",
// },
// };
CreateSnapshotCommand Input
See CreateSnapshotCommandInput for more details
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
ClusterName Required | string | undefined | The snapshot is created from this cluster. |
SnapshotName Required | string | undefined | A name for the snapshot being created. |
KmsKeyId | string | undefined | The ID of the KMS key used to encrypt the snapshot. |
Tags | Tag[] | undefined | A list of tags to be added to this resource. A tag is a key-value pair. A tag key must be accompanied by a tag value, although null is accepted. |
CreateSnapshotCommand Output
See CreateSnapshotCommandOutput for details
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
Snapshot | Snapshot | undefined | The newly-created snapshot. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
ClusterNotFoundFault | client | |
InvalidClusterStateFault | client | |
InvalidParameterCombinationException | client | |
InvalidParameterValueException | client | |
ServiceLinkedRoleNotFoundFault | client | |
SnapshotAlreadyExistsFault | client | |
SnapshotQuotaExceededFault | client | |
TagQuotaPerResourceExceeded | client | |
MemoryDBServiceException | Base exception class for all service exceptions from MemoryDB service. |