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.
Initiates an AMI copy operation. You must specify the source AMI ID and both the source and destination locations. The copy operation must be initiated in the destination Region.
CopyImage supports the following source to destination copies:
Region to Region
Region to Outpost
Parent Region to Local Zone
Local Zone to parent Region
Between Local Zones with the same parent Region (only supported for certain Local Zones)
CopyImage does not support the following source to destination copies:
Local Zone to non-parent Regions
Between Local Zones with different parent Regions
Local Zone to Outpost
Outpost to Local Zone
Outpost to Region
Between Outposts
Within same Outpost
Cross-partition copies (use CreateStoreImageTask instead)
Destination specification
Region to Region: The destination Region is the Region in which you initiate the copy operation.
Region to Outpost: Specify the destination using the DestinationOutpostArn
parameter (the ARN of the Outpost)
Region to Local Zone, and Local Zone to Local Zone copies: Specify the destination
using the DestinationAvailabilityZone
parameter (the name of the destination
Local Zone) or DestinationAvailabilityZoneId
parameter (the ID of the destination
Local Zone).
Snapshot encryption
Region to Outpost: Backing snapshots copied to an Outpost are encrypted by default using the default encryption key for the Region or the key that you specify. Outposts do not support unencrypted snapshots.
Region to Local Zone, and Local Zone to Local Zone: Not all Local Zones require encrypted snapshots. In Local Zones that require encrypted snapshots, backing snapshots are automatically encrypted during copy. In Local Zones where encryption is not required, snapshots retain their original encryption state (encrypted or unencrypted) by default.
For more information, including the required permissions for copying an AMI, see Copy an Amazon EC2 AMI in the Amazon EC2 User Guide.
For .NET Core this operation is only available in asynchronous form. Please refer to CopyImageAsync.
Namespace: Amazon.EC2
Assembly: AWSSDK.EC2.dll
Version: 3.x.y.z
public virtual CopyImageResponse CopyImage( CopyImageRequest request )
Container for the necessary parameters to execute the CopyImage service method.
This example copies the specified AMI from the us-east-1 region to the current region.
var client = new AmazonEC2Client(); var response = client.CopyImage(new CopyImageRequest { Description = "", Name = "My server", SourceImageId = "ami-5731123e", SourceRegion = "us-east-1" }); string imageId = response.ImageId;
.NET Framework:
Supported in: 4.5 and newer, 3.5