CopyClusterSnapshotCommand

Copies a snapshot of an elastic cluster.

Example Syntax

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

import { DocDBElasticClient, CopyClusterSnapshotCommand } from "@aws-sdk/client-docdb-elastic"; // ES Modules import
// const { DocDBElasticClient, CopyClusterSnapshotCommand } = require("@aws-sdk/client-docdb-elastic"); // CommonJS import
const client = new DocDBElasticClient(config);
const input = { // CopyClusterSnapshotInput
  snapshotArn: "STRING_VALUE", // required
  targetSnapshotName: "STRING_VALUE", // required
  kmsKeyId: "STRING_VALUE",
  copyTags: true || false,
  tags: { // TagMap
    "<keys>": "STRING_VALUE",
  },
};
const command = new CopyClusterSnapshotCommand(input);
const response = await client.send(command);
// { // CopyClusterSnapshotOutput
//   snapshot: { // ClusterSnapshot
//     subnetIds: [ // StringList // required
//       "STRING_VALUE",
//     ],
//     snapshotName: "STRING_VALUE", // required
//     snapshotArn: "STRING_VALUE", // required
//     snapshotCreationTime: "STRING_VALUE", // required
//     clusterArn: "STRING_VALUE", // required
//     clusterCreationTime: "STRING_VALUE", // required
//     status: "STRING_VALUE", // required
//     vpcSecurityGroupIds: [ // required
//       "STRING_VALUE",
//     ],
//     adminUserName: "STRING_VALUE", // required
//     kmsKeyId: "STRING_VALUE", // required
//     snapshotType: "STRING_VALUE",
//   },
// };

Example Usage

 Loading code editorLoading code editor

CopyClusterSnapshotCommand Input

See CopyClusterSnapshotCommandInput for more details

Parameter
Type
Description
snapshotArn
Required
string | undefined

The Amazon Resource Name (ARN) identifier of the elastic cluster snapshot.

targetSnapshotName
Required
string | undefined

The identifier of the new elastic cluster snapshot to create from the source cluster snapshot. This parameter is not case sensitive.

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: elastic-cluster-snapshot-5

copyTags
boolean | undefined

Set to true to copy all tags from the source cluster snapshot to the target elastic cluster snapshot. The default is false.

kmsKeyId
string | undefined

The Amazon Web Services KMS key ID for an encrypted elastic cluster snapshot. The Amazon Web Services KMS key ID is the Amazon Resource Name (ARN), Amazon Web Services KMS key identifier, or the Amazon Web Services KMS key alias for the Amazon Web Services KMS encryption key.

If you copy an encrypted elastic cluster snapshot from your Amazon Web Services account, you can specify a value for KmsKeyId to encrypt the copy with a new Amazon Web ServicesS KMS encryption key. If you don't specify a value for KmsKeyId, then the copy of the elastic cluster snapshot is encrypted with the same AWS KMS key as the source elastic cluster snapshot.

To copy an encrypted elastic cluster snapshot to another Amazon Web Services region, set KmsKeyId to the Amazon Web Services KMS key ID that you want to use to encrypt the copy of the elastic cluster snapshot in the destination region. Amazon Web Services KMS encryption keys are specific to the Amazon Web Services region that they are created in, and you can't use encryption keys from one Amazon Web Services region in another Amazon Web Services region.

If you copy an unencrypted elastic cluster snapshot and specify a value for the KmsKeyId parameter, an error is returned.

tags
Record<string, string> | undefined

The tags to be assigned to the elastic cluster snapshot.

CopyClusterSnapshotCommand Output

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

Returns information about a specific elastic cluster snapshot.

Throws

Name
Fault
Details
AccessDeniedException
client

An exception that occurs when there are not sufficient permissions to perform an action.

ConflictException
client

There was an access conflict.

InternalServerException
server

There was an internal server error.

ResourceNotFoundException
client

The specified resource could not be located.

ServiceQuotaExceededException
client

The service quota for the action was exceeded.

ThrottlingException
client

ThrottlingException will be thrown when request was denied due to request throttling.

ValidationException
client

A structure defining a validation exception.

DocDBElasticServiceException
Base exception class for all service exceptions from DocDBElastic service.