User guide
Caution
The AWS Resource APIs for .NET are currently provided as a preview. This means that these
resource APIs may frequently change in response to customer feedback, and these changes
may happen without advance notice. Until these resource APIs exit the preview stage, please
be cautious about writing and distributing production-quality code that relies on them.
Using the AWS Resource APIs for .NET provide these benefits:
• The resource APIs in the SDK for .NET are easier to understand conceptually than their low-level API
counterparts. The low-level APIs in the SDK for .NET typically consist of sets of matching
request-and-response objects that correspond to HTTP-based API calls focusing on somewhat isolated
AWS service constructs. In contrast, these resource APIs represent logical relationships among
resources within AWS services and intuitively use familiar .NET programming constructs.
• Code that you write with the resource APIs is easier for you and others to comprehend when compared
to their low-level API equivalents. Instead of writing somewhat complex request-and-response style
code with the low-level APIs to access resources, you can get directly to resources with the resource
APIs. If you're working with a team of developers in the same code base, it's typically easier to
understand what has already been coded and to start contributing quickly to existing code.
• You will typically write less code with the resource APIs than with equivalent low-level API code.
Request-and-response style code with the low-level APIs can sometimes be quite long. Equivalent
resource APIs code is typically much shorter, more compact, and easer to debug.
Here's a brief example of using C# and the AWS Resource APIs for .NET to create a new IAM user
account:
// using Amazon.IdentityManagement.Resources;
// using Amazon.IdentityManagement.Model;
var iam = new IdentityManagementService();
try
{
var user = iam.CreateUser("DemoUser");
Console.WriteLine("User Name = '{0}', ARN = '{1}'",
user.Name, user.Arn);
}
catch (EntityAlreadyExistsException)
{
Console.WriteLine("User 'DemoUser' already exists.");
}
Compare this to an equivalent example of using the low-level APIs:
// using Amazon.IdentityManagement;
// using Amazon.IdentityManagement.Model;
var client = new AmazonIdentityManagementServiceClient();
var request = new CreateUserRequest
{
UserName = "DemoUser"
};
try
{
Version v2.0.0
42
AWS SDK for .NET Developer Guide
AWS Resource APIs for .NET