AWS SDK Version 3 for .NET
API Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Container for the parameters to the CopySnapshot operation. Makes a copy of an existing snapshot.

This operation is valid for Valkey or Redis OSS only.

Users or groups that have permissions to use the CopySnapshot operation can create their own Amazon S3 buckets and copy snapshots to it. To control access to your snapshots, use an IAM policy to control who has the ability to use the CopySnapshot operation. For more information about using IAM to control the use of ElastiCache operations, see Exporting Snapshots and Authentication & Access Control.

You could receive the following error messages.

Error Messages

Inheritance Hierarchy

System.Object
  Amazon.Runtime.AmazonWebServiceRequest
    Amazon.ElastiCache.AmazonElastiCacheRequest
      Amazon.ElastiCache.Model.CopySnapshotRequest

Namespace: Amazon.ElastiCache.Model
Assembly: AWSSDK.ElastiCache.dll
Version: 3.x.y.z

Syntax

C#
public class CopySnapshotRequest : AmazonElastiCacheRequest
         IAmazonWebServiceRequest

The CopySnapshotRequest type exposes the following members

Constructors

NameDescription
Public Method CopySnapshotRequest()

Properties

NameTypeDescription
Public Property KmsKeyId System.String

Gets and sets the property KmsKeyId.

The ID of the KMS key used to encrypt the target snapshot.

Public Property SourceSnapshotName System.String

Gets and sets the property SourceSnapshotName.

The name of an existing snapshot from which to make a copy.

Public Property Tags System.Collections.Generic.List<Amazon.ElastiCache.Model.Tag>

Gets and sets the property Tags.

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.

Public Property TargetBucket System.String

Gets and sets the property TargetBucket.

The Amazon S3 bucket to which the snapshot is exported. This parameter is used only when exporting a snapshot for external access.

When using this parameter to export a snapshot, be sure Amazon ElastiCache has the needed permissions to this S3 bucket. For more information, see Step 2: Grant ElastiCache Access to Your Amazon S3 Bucket in the Amazon ElastiCache User Guide.

For more information, see Exporting a Snapshot in the Amazon ElastiCache User Guide.

Public Property TargetSnapshotName System.String

Gets and sets the property TargetSnapshotName.

A name for the snapshot copy. ElastiCache does not permit overwriting a snapshot, therefore this name must be unique within its context - ElastiCache or an Amazon S3 bucket if exporting.

Examples

Copies a snapshot to a specified name.

CopySnapshot


var client = new AmazonElastiCacheClient();
var response = client.CopySnapshot(new CopySnapshotRequest 
{
    SourceSnapshotName = "my-snapshot",
    TargetBucket = "",
    TargetSnapshotName = "my-snapshot-copy"
});

Snapshot snapshot = response.Snapshot;

            

Version Information

.NET:
Supported in: 8.0 and newer, Core 3.1

.NET Standard:
Supported in: 2.0

.NET Framework:
Supported in: 4.5 and newer, 3.5