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.

Constructs the import manifest for the image and then uploads it and the virtual machine image or disk image to Amazon S3. The S3 key to the uploaded manifest file is returned.

If an error occurs during upload of the image file the RetainArtifactsOnUploadError property governs whether the partially uploaded content is deleted or retained. If the content is retained, the import can be resumed. By default the RetainArtifactsOnUploadError property is false and the content deleted, avoiding storage charges for potentially orphaned content if the command is not re-run.

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


public String Upload(
         String imageFilepath,
         String fileFormat,
         Nullable<Int64> volumeSize,
         String keyPrefix,
         ImportProgressCallback progressCallback,
         Boolean resumeUpload
Type: System.String

The full path to the image file to be processed

Type: System.String

The format of the image file (VMDK | RAW | VHD). If not specified, it will be inferred from the extension of the image file.

Type: System.Nullable<System.Int64>

The requested size (in GiB) for the resulting image volume. If not specified a suitable value based on the size of the image file is used. Note that if importing a disk image that will be used as an EC2 instance, the minimum required boot volume size is 8GB.

Type: System.String

Optional root-level key prefix that will be applied to the uploaded artifacts in S3. The artifacts will be placed beneath this (or the root if not set) in a key composed of a GUID.

Type: Amazon.EC2.Import.ImportProgressCallback

Optional callback delegate for upload progress reporting

Type: System.Boolean

Set this to true if a previous upload failed part-way through processing and RetainArtifactsOnUploadError was set to true so the partially uploaded content was retained. The existing manifest will be inspected and uploads will resume of the retaining content.

Return Value
Type: String
The S3 object key of the uploaded manifest file

Version Information

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