User guide
Table Of Contents
- AWS SDK for .NET
- Table of Contents
- AWS SDK for .NET Developer Guide
- Getting Started with the AWS SDK for .NET
- Programming with the AWS SDK for .NET
- AWS SDK for .NET Tutorials and Examples
- Managing ASP.NET Session State with Amazon DynamoDB
- Tutorial: Creating Amazon EC2 Instances with the AWS SDK for .NET
- Tutorial: Grant Access Using an IAM Role and the AWS SDK for .NET
- Tutorial: Amazon EC2 Spot Instances
- Creating and Using an Amazon SQS Queue with the AWS SDK for .NET
- Creating an Amazon Route 53 Hosted Zone and Adding Resource Record Sets
- Additional Resources
- Document History

<configuration>
<appSettings>
<add key="AWSProfileName" value="development"/>
</appSettings>
</configuration>
This example assumes that you are using the SDK Store or a credentials file in the default location, under
the current user's home directory. If your profiles are stored in a credentials file in an arbitrary location,
specify the location by adding an AWSProfilesLocation value to appSettings.The following example
specifies C:\aws_service_credentials\credentials as the credentials file.
<configuration>
<appSettings>
<add key="AWSProfileName" value="development"/>
<add key="AWSProfilesLocation" value="C:\aws_service_credentials\creden
tials"/>
</appSettings>
</configuration>
You can reference a profile programmatically by using Amazon.Runtime.StoredProfileAWSCreden-
tials. The following example references a profile named development and uses it to create an
AmazonS3Client object.
AWSCredentials credentials = new StoredProfileAWSCredentials("development");
IAmazonS3 s3Client = new AmazonS3Client(credentials, RegionEndpoint.USWest2);
Tip
If you want to use the default profile, omit the AWSCredentials object, and the SDK for .NET
will automatically use your default credentials to create the client object.
Specifying Roles or Temporary Credentials
For applications that run on Amazon EC2 instances, the most secure way to manage credentials is to
use IAM roles for EC2 Instances. See the following topic for more information.
• Using IAM Roles for EC2 Instances with the SDK for .NET (p. 47)
For application scenarios in which the software executable will be available to users outside your organ-
ization, we recommend that you design the software to use temporary security credentials. In addition to
providing restricted access to AWS resources, these credentials have the benefit of expiring after a specified
period of time. For more information about temporary security credentials, go to:
• Using Security Tokens to Grant Temporary Access to Your AWS Resources
• Authenticating Users of AWS Mobile Applications with a Token Vending Machine.
Although the title of the second article above refers specifically to mobile applications, the article itself
contains information that is useful for any AWS application that is deployed outside of your organization.
Using Proxy Credentials
If your software communicates with AWS through a proxy, you should specify credentials for the proxy
using the ProxyCredentials property on the ClientConfig class for the service. For example, for Amazon
S3, you could use code similar to the following, where foo and bar are the proxy username and password
specified in a NetworkCredential object.
Version v2.0.0
12
AWS SDK for .NET Developer Guide
Configuring AWS Credentials