CopyDBClusterSnapshot - Amazon Relational Database Service
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China.

CopyDBClusterSnapshot

Copies a snapshot of a DB cluster.

To copy a DB cluster snapshot from a shared manual DB cluster snapshot, SourceDBClusterSnapshotIdentifier must be the Amazon Resource Name (ARN) of the shared DB cluster snapshot.

You can copy an encrypted DB cluster snapshot from another Amazon Region. In that case, the Amazon Region where you call the CopyDBClusterSnapshot action is the destination Amazon Region for the encrypted DB cluster snapshot to be copied to. To copy an encrypted DB cluster snapshot from another Amazon Region, you must provide the following values:

  • KmsKeyId - The Amazon Key Management System (Amazon KMS) key identifier for the key to use to encrypt the copy of the DB cluster snapshot in the destination Amazon Region.

  • PreSignedUrl - A URL that contains a Signature Version 4 signed request for the CopyDBClusterSnapshot action to be called in the source Amazon Region where the DB cluster snapshot is copied from. The pre-signed URL must be a valid request for the CopyDBClusterSnapshot API action that can be executed in the source Amazon Region that contains the encrypted DB cluster snapshot to be copied.

    The pre-signed URL request must contain the following parameter values:

    • KmsKeyId - The Amazon KMS key identifier for the KMS key to use to encrypt the copy of the DB cluster snapshot in the destination Amazon Region. This is the same identifier for both the CopyDBClusterSnapshot action that is called in the destination Amazon Region, and the action contained in the pre-signed URL.

    • DestinationRegion - The name of the Amazon Region that the DB cluster snapshot is to be created in.

    • SourceDBClusterSnapshotIdentifier - The DB cluster snapshot identifier for the encrypted DB cluster snapshot to be copied. This identifier must be in the Amazon Resource Name (ARN) format for the source Amazon Region. For example, if you are copying an encrypted DB cluster snapshot from the us-west-2 Amazon Region, then your SourceDBClusterSnapshotIdentifier looks like the following example: arn:aws:rds:us-west-2:123456789012:cluster-snapshot:aurora-cluster1-snapshot-20161115.

    To learn how to generate a Signature Version 4 signed request, see Authenticating Requests: Using Query Parameters (Amazon Signature Version 4) and Signature Version 4 Signing Process.

    Note

    If you are using an Amazon SDK tool or the Amazon CLI, you can specify SourceRegion (or --source-region for the Amazon CLI) instead of specifying PreSignedUrl manually. Specifying SourceRegion autogenerates a pre-signed URL that is a valid request for the operation that can be executed in the source Amazon Region.

  • TargetDBClusterSnapshotIdentifier - The identifier for the new copy of the DB cluster snapshot in the destination Amazon Region.

  • SourceDBClusterSnapshotIdentifier - The DB cluster snapshot identifier for the encrypted DB cluster snapshot to be copied. This identifier must be in the ARN format for the source Amazon Region and is the same value as the SourceDBClusterSnapshotIdentifier in the pre-signed URL.

To cancel the copy operation once it is in progress, delete the target DB cluster snapshot identified by TargetDBClusterSnapshotIdentifier while that DB cluster snapshot is in "copying" status.

For more information on copying encrypted DB cluster snapshots from one Amazon Region to another, see Copying a Snapshot in the Amazon Aurora User Guide.

For more information on Amazon Aurora, see What Is Amazon Aurora? in the Amazon Aurora User Guide.

Note

This action only applies to Aurora DB clusters.

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

CopyTags

A value that indicates whether to copy all tags from the source DB cluster snapshot to the target DB cluster snapshot. By default, tags are not copied.

Type: Boolean

Required: No

KmsKeyId

The Amazon KMS key identifier for an encrypted DB cluster snapshot. The Amazon KMS key identifier is the key ARN, key ID, alias ARN, or alias name for the Amazon KMS key.

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

If you copy an encrypted DB cluster snapshot that is shared from another Amazon account, then you must specify a value for KmsKeyId.

To copy an encrypted DB cluster snapshot to another Amazon Region, you must set KmsKeyId to the Amazon KMS key identifier you want to use to encrypt the copy of the DB cluster snapshot in the destination Amazon Region. KMS keys are specific to the Amazon Region that they are created in, and you can't use KMS keys from one Amazon Region in another Amazon Region.

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

Type: String

Required: No

PreSignedUrl

The URL that contains a Signature Version 4 signed request for the CopyDBClusterSnapshot API action in the Amazon Region that contains the source DB cluster snapshot to copy. The PreSignedUrl parameter must be used when copying an encrypted DB cluster snapshot from another Amazon Region. Don't specify PreSignedUrl when you are copying an encrypted DB cluster snapshot in the same Amazon Region.

The pre-signed URL must be a valid request for the CopyDBClusterSnapshot API action that can be executed in the source Amazon Region that contains the encrypted DB cluster snapshot to be copied. The pre-signed URL request must contain the following parameter values:

  • KmsKeyId - The Amazon KMS key identifier for the KMS key to use to encrypt the copy of the DB cluster snapshot in the destination Amazon Region. This is the same identifier for both the CopyDBClusterSnapshot action that is called in the destination Amazon Region, and the action contained in the pre-signed URL.

  • DestinationRegion - The name of the Amazon Region that the DB cluster snapshot is to be created in.

  • SourceDBClusterSnapshotIdentifier - The DB cluster snapshot identifier for the encrypted DB cluster snapshot to be copied. This identifier must be in the Amazon Resource Name (ARN) format for the source Amazon Region. For example, if you are copying an encrypted DB cluster snapshot from the us-west-2 Amazon Region, then your SourceDBClusterSnapshotIdentifier looks like the following example: arn:aws:rds:us-west-2:123456789012:cluster-snapshot:aurora-cluster1-snapshot-20161115.

To learn how to generate a Signature Version 4 signed request, see Authenticating Requests: Using Query Parameters (Amazon Signature Version 4) and Signature Version 4 Signing Process.

Note

If you are using an Amazon SDK tool or the Amazon CLI, you can specify SourceRegion (or --source-region for the Amazon CLI) instead of specifying PreSignedUrl manually. Specifying SourceRegion autogenerates a pre-signed URL that is a valid request for the operation that can be executed in the source Amazon Region.

Type: String

Required: No

SourceDBClusterSnapshotIdentifier

The identifier of the DB cluster snapshot to copy. This parameter isn't case-sensitive.

You can't copy an encrypted, shared DB cluster snapshot from one Amazon Region to another.

Constraints:

  • Must specify a valid system snapshot in the "available" state.

  • If the source snapshot is in the same Amazon Region as the copy, specify a valid DB snapshot identifier.

  • If the source snapshot is in a different Amazon Region than the copy, specify a valid DB cluster snapshot ARN. For more information, go to Copying Snapshots Across Amazon Regions in the Amazon Aurora User Guide.

Example: my-cluster-snapshot1

Type: String

Required: Yes

Tags.Tag.N

A list of tags. For more information, see Tagging Amazon RDS Resources in the Amazon RDS User Guide.

Type: Array of Tag objects

Required: No

TargetDBClusterSnapshotIdentifier

The identifier of the new DB cluster snapshot to create from the source DB cluster snapshot. This parameter isn't case-sensitive.

Constraints:

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

  • First character must be a letter.

  • Can't end with a hyphen or contain two consecutive hyphens.

Example: my-cluster-snapshot2

Type: String

Required: Yes

Response Elements

The following element is returned by the service.

DBClusterSnapshot

Contains the details for an Amazon RDS DB cluster snapshot

This data type is used as a response element in the DescribeDBClusterSnapshots action.

Type: DBClusterSnapshot object

Errors

For information about the errors that are common to all actions, see Common Errors.

DBClusterSnapshotAlreadyExistsFault

The user already has a DB cluster snapshot with the given identifier.

HTTP Status Code: 400

DBClusterSnapshotNotFoundFault

DBClusterSnapshotIdentifier doesn't refer to an existing DB cluster snapshot.

HTTP Status Code: 404

InvalidDBClusterSnapshotStateFault

The supplied value isn't a valid DB cluster snapshot state.

HTTP Status Code: 400

InvalidDBClusterStateFault

The requested operation can't be performed while the cluster is in this state.

HTTP Status Code: 400

KMSKeyNotAccessibleFault

An error occurred accessing an Amazon KMS key.

HTTP Status Code: 400

SnapshotQuotaExceeded

The request would result in the user exceeding the allowed number of DB snapshots.

HTTP Status Code: 400

Examples

Example

This example illustrates one usage of CopyDBClusterSnapshot.

Sample Request

https://rds.us-west-2.amazonaws.com/ ?Action=CopyDBClusterSnapshot &SignatureMethod=HmacSHA256 &SignatureVersion=4 &SourceDBClusterSnapshotIdentifier=rds%3Asample-cluster-2016-09-14-10-38 &TargetDBClusterSnapshotIdentifier=cluster-snapshot-copy-1 &Version=2014-10-31 &X-Amz-Algorithm=AWS4-HMAC-SHA256 &X-Amz-Credential=AKIADQKE4SARGYLE/20160914/us-west-2/rds/aws4_request &X-Amz-Date=20160914T164919Z &X-Amz-SignedHeaders=content-type;host;user-agent;x-amz-content-sha256;x-amz-date &X-Amz-Signature=4503d6112f2ab5332d7d1871cba6b97ddcc9748d3d4da0cb2c219ace80cfd384

Sample Response

<CopyDBClusterSnapshotResponse xmlns="http://rds.amazonaws.com/doc/2014-10-31/"> <CopyDBClusterSnapshotResult> <DBClusterSnapshot> <MasterUsername>mymasteruser</MasterUsername> <AllocatedStorage>1</AllocatedStorage> <SnapshotType>manual</SnapshotType> <AvailabilityZones> <AvailabilityZone>us-west-2a</AvailabilityZone> <AvailabilityZone>us-west-2b</AvailabilityZone> <AvailabilityZone>us-west-2c</AvailabilityZone> </AvailabilityZones> <StorageEncrypted>false</StorageEncrypted> <Engine>aurora</Engine> <Port>0</Port> <LicenseModel>aurora</LicenseModel> <SnapshotCreateTime>2016-09-14T10:38:05.616Z</SnapshotCreateTime> <PercentProgress>100</PercentProgress> <VpcId>vpc-e97e7d8d</VpcId> <DBClusterSnapshotIdentifier>cluster-snapshot-copy-1</DBClusterSnapshotIdentifier> <DBClusterSnapshotArn>arn:aws:rds:us-west-2:123456789012:cluster-snapshot:cluster-snapshot-copy-1</DBClusterSnapshotArn> <DBClusterIdentifier>sample-cluster</DBClusterIdentifier> <ClusterCreateTime>2016-09-13T16:57:52.695Z</ClusterCreateTime> <Status>available</Status> </DBClusterSnapshot> </CopyDBClusterSnapshotResult> <ResponseMetadata> <RequestId>2e861f29-7a9b-11e6-94c8-21ac69ee8f8c</RequestId> </ResponseMetadata> </CopyDBClusterSnapshotResponse>

See Also

For more information about using this API in one of the language-specific Amazon SDKs, see the following: