Welcome to the new modularized AWS SDK for .NET.

The new version 3 of the AWS SDK for .NET modularizes the SDK into separate NuGet packages for each service. This allows your application to include much smaller assemblies and only have updates when the services you use are updated.

Getting Started

Before getting started developing with AWS, read here about configuring your AWS credentials.

The basic steps to using the SDK are:

The following sample shows how to do those steps to upload an object to Amazon.S3.

using System;
using Amazon;
using Amazon.S3;
using Amazon.S3.Model;
namespace SampleApp
{
    class Program
    {
        static void Main(string[] args)
        {
            string bucketName = ...; // Set to a bucket you create
            // Create S3 service client.
            using (IAmazonS3 s3Client = new AmazonS3Client(RegionEndpoint.USWest2))
            {
                // Setup request for putting an object in S3.
                PutObjectRequest request = new PutObjectRequest
                {
                    BucketName = bucketName,
                    Key = "SampleData",
                    ContentBody = "Sample Content"
                };
                // Make service call and get back the response.
                PutObjectResponse response = s3Client.PutObject(request);
            }
        }
    }
}
        

Changes from Version 2

We have tried to keep the list of breaking changes to a minimum to make it as easy as possible to adopt to the new modularized SDK. Here are the breaking changes when moving from V2 to V3 of the SDK.

Amazon.AWSClientFactory Removed

This class was removed because in the modularized SDK it didn't make sense to have a class that had a dependency to every service. Instead, the preferred way to construct a service client is to just use its constructor.

Amazon.Runtime.AssumeRoleAWSCredentials Removed

This class was removed because it was in a core namespace but had a dependency to the AWS Security Token Service. It has been obsolete in the SDK for quite some time and will be removed with the new structure. Use Amazon.SecurityToken.AssumeRoleAWSCredentials instead.

SetACL from S3Link

S3Link is part of the Amazon DynamoDB package and is used for storing objects in Amazon S3 that are references in a DynamoDB item. This is a useful feature, but we didn't want to cause a compile dependency on the S3 package for DynamoDB. Consequently, we needed to simplify the exposed S3 methods from S3Link, so we replaced SetACL with MakeS3ObjectPublic. For more control over the ACL on the object, you'll need to use the S3 package directly.

Removal of Obsolete Result Classes

For most all services in the SDK, operations return a response object that contains metadata for the operation such as the request ID and a result object. We found having a separate response and result class was redundant and mostly just caused extra typing for developers. About a year and half ago when version 2 of the SDK was released, we put all the information that was on the result class on to the response class. We also marked the result classes obsolete to discourage their use. In the new modularized SDK currently in development, we removed these obsolete result classes. This helps us reduce the size of the SDK.

Platform Support

We have removed platform-specific assemblies from the NuGet packages for Windows Store and Windows Phone 8. Windows Store and Windows Phone projects will use the portable target. In addition, the portable target is now available in all AWS SDK for .NET client packages.

AWS Config Section Changes

It is possible to do advanced configuration of the SDK through the app.config or web.config file. This is done through an aws config section like the following that references the SDK assembly name.

<configuration>
  <configSections>
    <section name="aws" type="Amazon.AWSSection, AWSSDK"/>
  </configSections>
  <aws region="us-west-2">
    <logging logTo="Log4Net"/>  
  </aws>
</configuration>

In the modularized SDK, there is no longer an assembly called AWSSDK. Instead, we need to reference the new core assembly like this.

<configuration>
  <configSections>
    <section name="aws" type="Amazon.AWSSection, AWSSDK.Core"/>
  </configSections>
  <aws region="us-west-2">
    <logging logTo="Log4Net"/>  
  </aws>
</configuration>

You can also manipulate the config settings through an Amazon.AWSConfigs object. In the modularized SDK, we moved config settings for DynamoDB from the Amazon.AWSConfigs object to Amazon.AWSConfigsDynamoDB.

Links