Resource APIs for AWS SDK for .NET (Developer Preview)

Posted on: Jan 7, 2015

The new Resource APIs for AWS SDK for .NET introduce a more intuitive and object-oriented way of working with AWS services for .NET developers. Instead of the traditional request-response coding pattern, Resource APIs represent AWS resources as .NET objects with methods that map to API actions and attributes that are automatically loaded from the service upon first-time access. Also, Resource APIs abstract out pagination in "List*" operations and allow you to easily iterate over large resource sets.

Here's a bit of sample code to demonstrate these features:

// Construct a service object
var iam = new IdentityManagementService();

// Get a reference to a resource (IAM group)
var adminGroup = iam.GetGroupByName("admin");

// Access attributes with implicit Describe or Get requests
var adminCreated = adminGroup.CreateDate;

// Iterate through automatically paginated resource sets
foreach (var user in adminGroup.GetUsers())
{
Console.WriteLine(user.Name);
}

// Use built-in methods for taking resource actions
adminGroup.Delete();

The Resource APIs currently support Amazon SQS, Amazon SNS, Amazon Glacier, AWS CloudFormation, and AWS IAM. Support for more services will be added during the preview period. We encourage you to try out the new APIs and send us feedback via GitHub Issues (https://github.com/aws/aws-sdk-net/issues).

Resources to get started:
Read the Developer Guide on Resource APIs
Download the binaries: https://github.com/aws/aws-sdk-net/tree/resourceAPI-preview/binaries
Browse the Code: https://github.com/aws/aws-sdk-net/tree/resourceAPI-preview
Check out the API reference
Find the latest information on AWS .NET Development Blog