User guide

Another way to configure an application is to edit the appSettings element in the project's App.config
or Web.config file.The following example specifies the AWSRegion (p. 16) and AWSLogging (p. 15)
parameters.
<configuration>
<appSettings>
<add key="AWSRegion" value="us-west-2"/>
<add key="AWSLogging" value="log4net"/>
</appSettings>
</configuration>
These settings take affect only after the application has been rebuilt.
Although you can configure an SDK for .NET application programmatically by setting property values in
the AWSConfigs class, we recommend that you use the aws element instead.The following example
specifies the AWSRegion (p. 16) and AWSLogging (p. 15) parameters:
AWSConfigs.AWSRegion = "us-west-2";
AWSConfigs.Logging = LoggingOptions.Log4Net;
Programmatically defined parameters override any values that were specified in an App.config or
Web.config file. Some programmatically defined parameter values take effect immediately; others take
effect only after you create a new client object. For more information, see Configuring AWS
Credentials (p. 9).
Topics
Configuring AWS Credentials (p. 9)
AWS Region Selection (p. 13)
Configuring Other Application Parameters (p. 14)
Configuration Files Reference for AWS SDK for .NET (p. 18)
Configuring AWS Credentials
This topic describes how to configure your application's AWS credentials. It assumes that you have
created an AWS account and that you have access to your credentials, as described in Create an AWS
Account and Credentials (p. 3). It is important to manage your credentials securely and avoid practices
that could unintentionally expose your credentials publicly. In particular:
Don't use your account's root credentials to access your AWS resources.
These credentials provide unrestricted account access, and are difficult to revoke.
Don't put literal access keys in your application, including the project's App.config or Web.config
file.
Doing so creates a risk of accidentally exposing your credentials if, for example, you upload the project
to a public repository.
Some general guidelines for securely managing credentials include:
Create IAM users and use those credentials to provide account access instead of your account's root
credentials.
Version v2.0.0
9
AWS SDK for .NET Developer Guide
Configuring AWS Credentials