User guide
AWS SDK for .NET Tutorials and
Examples
This chapter provides tutorials, walkthroughs, and examples of programming Amazon Web Services with
the AWS SDK for .NET. Since these topics generally provide buildable and runnable examples of SDK
for .NET programming, it is expected that you have already set up the AWS SDK for .NET (p. 3) and
that you understand the material in the Programming with the AWS SDK for .NET (p. 8) chapter.
Topics
• Using IAM Roles for Amazon EC2 Instances with the AWS SDK for .NET (p. 31)
• Managing ASP.NET Session State with Amazon DynamoDB (p. 39)
• Tutorial: Creating Amazon EC2 Instances with the AWS SDK for .NET (p. 43)
• Tutorial: Amazon EC2 Spot Instances (p. 52)
• Creating and Using an Amazon SQS Queue with the AWS SDK for .NET (p. 60)
Using IAM Roles for Amazon EC2 Instances with
the AWS SDK for .NET
Note
For in-depth information about IAM roles for Amazon EC2 instances, go to Using Identity and
Access Management.
Securely managing authentication credentials is one of the challenges developers face when writing
software that accesses Amazon Web Services (AWS). All requests to AWS must be cryptographically
signed using credentials issued by AWS. For software that runs on Amazon Elastic Compute Cloud
(Amazon EC2) instances, developers must store these credentials in a way that keeps them secure but
also accessible to the software, which needs them in order to make requests.
IAM roles for Amazon EC2 instances provides an effective way to manage credentials for AWS software
running on EC2 instances. This section describes IAM roles for Amazon EC2 instances and shows how
it works with a sample .NET program. But first, let's examine some common strategies for managing
credentials and the issues that arise when using them.
One strategy is to first launch an Amazon EC2 instance and then securely transfer the credentials to the
instance using a utility such as scp (secure copy). However, this strategy doesn't scale well to large
Version v2.0.0
31
AWS SDK for .NET Developer Guide
IAM Roles for Amazon EC2 Instances