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 CopyImage operation. Initiates the copy of an AMI from the specified source region to the current region. You specify the destination region by using its endpoint when making the request.

For more information about the prerequisites and limits when copying an AMI, see Copying an AMI in the Amazon Elastic Compute Cloud User Guide.

Inheritance Hierarchy

System.Object
  Amazon.Runtime.AmazonWebServiceRequest
    Amazon.EC2.AmazonEC2Request
      Amazon.EC2.Model.CopyImageRequest

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

Syntax

C#
public class CopyImageRequest : AmazonEC2Request
         IAmazonWebServiceRequest

The CopyImageRequest type exposes the following members

Constructors

NameDescription
Public Method CopyImageRequest()

Properties

NameTypeDescription
Public Property ClientToken System.String

Gets and sets the property ClientToken.

Unique, case-sensitive identifier you provide to ensure idempotency of the request. For more information, see How to Ensure Idempotency in the Amazon Elastic Compute Cloud User Guide.

Public Property Description System.String

Gets and sets the property Description.

A description for the new AMI in the destination region.

Public Property Encrypted System.Boolean

Gets and sets the property Encrypted.

Specifies whether the destination snapshots of the copied image should be encrypted. The default CMK for EBS is used unless a non-default AWS Key Management Service (AWS KMS) CMK is specified with KmsKeyId. For more information, see Amazon EBS Encryption in the Amazon Elastic Compute Cloud User Guide.

Public Property KmsKeyId System.String

Gets and sets the property KmsKeyId.

An identifier for the AWS Key Management Service (AWS KMS) customer master key (CMK) to use when creating the encrypted volume. This parameter is only required if you want to use a non-default CMK; if this parameter is not specified, the default CMK for EBS is used. If a KmsKeyId is specified, the Encrypted flag must also be set.

The CMK identifier may be provided in any of the following formats:

  • Key ID

  • Key alias, in the form alias/ExampleAlias

  • ARN using key ID. The ID ARN contains the arn:aws:kms namespace, followed by the region of the CMK, the AWS account ID of the CMK owner, the key namespace, and then the CMK ID. For example, arn:aws:kms:us-east-1:012345678910:key/abcd1234-a123-456a-a12b-a123b4cd56ef.

  • ARN using key alias. The alias ARN contains the arn:aws:kms namespace, followed by the region of the CMK, the AWS account ID of the CMK owner, the alias namespace, and then the CMK alias. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias.

AWS parses KmsKeyId asynchronously, meaning that the action you call may appear to complete even though you provided an invalid identifier. This action will eventually report failure.

The specified CMK must exist in the region that the snapshot is being copied to.

Public Property Name System.String

Gets and sets the property Name.

The name of the new AMI in the destination region.

Public Property SourceImageId System.String

Gets and sets the property SourceImageId.

The ID of the AMI to copy.

Public Property SourceRegion System.String

Gets and sets the property SourceRegion.

The name of the region that contains the AMI to copy.

Examples

This example copies the specified AMI from the us-east-1 region to the current region.

To copy an AMI to another region


var response = client.CopyImage(new CopyImageRequest 
{
    Description = "",
    Name = "My server",
    SourceImageId = "ami-5731123e",
    SourceRegion = "us-east-1"
});

string imageId = response.ImageId;

            

Version Information

.NET Standard:
Supported in: 1.3

.NET Framework:
Supported in: 4.5, 4.0, 3.5

Portable Class Library:
Supported in: Windows Store Apps
Supported in: Windows Phone 8.1
Supported in: Xamarin Android
Supported in: Xamarin iOS (Unified)
Supported in: Xamarin.Forms