What's New?
| Change | Description |
|---|---|
| Amazon S3 Multipart API |
Amazon S3 Multipart API allows large objects to be upload in independent parts. When these parts are uploaded the object
can be reassembled into a normal Amazon S3 object in Amazon S3. Uploading large objects
in smaller parts allows better for performance and reliability.
The following code sample demonstrates how to use the multipart API to upload a file.
AmazonS3 s3Client = new AmazonS3Client(AccessKeyID, SecretAccessKey);
// List to store upload part responses.
List<UploadPartResponse> uploadResponses = new List<UploadPartResponse>();
// 1. Initialize.
InitiateMultipartUploadRequest initRequest =
new InitiateMultipartUploadRequest()
.WithBucketName(existingBucketName)
.WithKey(keyName);
InitiateMultipartUploadResponse initResponse =
s3Client.InitiateMultipartUpload(initRequest);
// 2. Upload Parts.
long contentLength = new FileInfo(filePath).Length;
long partSize = 5242880; // 5 MB
try
{
long filePosition = 0;
for (int partNumber = 1; filePosition < contentLength; partNumber++)
{
// Create request to upload a part.
UploadPartRequest uploadRequest = new UploadPartRequest()
.WithBucketName(existingBucketName)
.WithKey(keyName)
.WithUploadId(initResponse.UploadId)
.WithPartNumber(partNumber)
.WithPartSize(partSize)
.WithFilePosition(filePosition)
.WithFilePath(filePath);
// Upload part and add response to our list.
uploadResponses.Add(s3Client.UploadPart(uploadRequest));
filePosition += partSize;
}
// Step 3: complete.
CompleteMultipartUploadRequest compRequest =
new CompleteMultipartUploadRequest()
.WithBucketName(existingBucketName)
.WithKey(keyName)
.WithUploadId(initResponse.UploadId)
.WithPartETags(uploadResponses);
CompleteMultipartUploadResponse completeUploadResponse =
s3Client.CompleteMultipartUpload(compRequest);
}
catch (Exception exception)
{
Console.WriteLine("Exception occurred: {0}", exception.Message);
s3Client.AbortMultipartUpload(new AbortMultipartUploadRequest()
.WithBucketName(existingBucketName)
.WithKey(keyName)
.WithUploadId(initResponse.UploadId));
}
|
| Amazon S3 Transfer Utility |
The AWS SDK for .NET includes a new helper class called TransferUtility in the Amazon.S3.Transfer namespace.
This class has methods for uploading and downloading objects from Amazon S3 that are easier to use then the main
AmazonS3Client. For uploading, the TransferUtility automatically decides based on the file size whether
to use a regular PutObject operation or the new multipart API. If a file is specified as opposed to a stream
then multiple threads are used to upload the file.
This code sample accomplishes the same task as the above code sample.
TransferUtility transferUtility = new
TransferUtility(accessKeyID, secretAccessKey);
transferUtility.Upload(filePath, existingBucketName);
Console.WriteLine("Upload 1 completed");
|
| Amazon CloudFront Custom Origin |
Amazon CloudFront now allows custom origins to be specified. Any origin server that isn't hosted on Amazon S3 is a custom origin.
To learn more about the release of custom origins, please visit the Amazon CloudFront Developer Guide..
The following code sample shows how to create a CloudFront distribution with a custom origin.
CloudFrontDistributionConfig config = new CloudFrontDistributionConfig();
config.DefaultRootObject = "index.html";
config.WithCallerReference(callerReference);
config.WithCustomOrigin(new CustomOrigin()
.WithDNSName("aws.amazon.com")
.WithProtocolPolicy(OriginProtocolPolicy.HttpOnly));
CreateDistributionRequest createRequest = new CreateDistributionRequest();
createRequest.WithDistributionConfig(config);
CreateDistributionResponse createResponse = CFClient.CreateDistribution(createRequest);
|
| Minor Changes |
Fixed an issue with
|
Migration issues introduced in the 1.1.0 release
The 1.1.0 release contains the following changes to Amazon RDS, Amazon Elastic Load Balancing and Amazon Elastic MapReduce that might affect existing applications.
| Title | Description |
|---|---|
| ResponseMeta | The classes Amazon.ElasticLoadBalancing.Model.ResponseMeta, Amazon.ElasticMapReduce.Model.ResponseMeta and Amazon.RDS.Model.ResponseMeta was moved to the common location Amazon.Runtime.ResponseMeta. |
| Removed ToXML methods | The ToXML methods were removed so the responses can be streamed from the services for improved performance. |
| Amazon RDS Data Type Changes |
|
| Amazon RDS Property Name Changes | The following property names were pluralized.
|
| Amazon Elastic Load Balancing Data Type Changes |
|
| Amazon Elastic MapReduce Data Type Changes |
|
Supported API Versions
This release of the AWS SDK for .NET supports the following API versions:
| Service | API Version |
|---|---|
| Amazon EC2 | 2010-08-31 |
| Amazon S3 | 2006-03-01 |
| Amazon SimpleDB | 2009-04-15 |
| Amazon RDS | 2010-07-28 |
| Amazon CloudFront | 2010-11-01 |
| Amazon SQS | 2009-02-01 |
| Amazon Elastic MapReduce | 2009-03-31 |
| Amazon CloudWatch | 2009-05-15 |
| Amazon Elastic Load Balancing | 2010-07-01 |
| Amazon Auto Scaling | 2009-05-15 |
| Amazon Simple Notification Service | 2010-03-31 |
| Amazon Identity and Access Management | 2010-05-08 |
| AWS Import/Export | 2010-06-01 |
Known Issues
| Issue | Description |
|---|---|
| Installation Requires Administrator Privileges | The default install location is %PROGRAMFILES%, which on most computers is "c:\program files". In order to install files to the default location, the MSI must be run by an Administrator. If you don't have Administrator privileges on the machine, please change the install location to something like "c:\Documents and Settings\<you>\AWS SDK for .NET", and the install will complete successfully. If you are running on Vista, your personal folder is similar to "c:\users\<you>\". |
| Uninstalling the SDK Produces "Unknown Publisher" Message | On Windows Vista, uninstalling the MSI results in an "Unknown Publisher" dialog even though the installer is signed by Amazon Web Services. This is a known Windows Installer bug on Windows Vista, and is documented here: http://support.microsoft.com/kb/929467/en-us |
Download the AWS SDK for .NET from http://aws.amazon.com/sdkfornet/.