User guide

AmazonEC2Config config = new AmazonEC2Config();
config.ServiceURL = "https://us-east-1.amazonaws.com";
Amazon.Runtime.AWSCredentials credentials = new Amazon.Runtime.StoredPro
fileAWSCredentials("profile_name");
AmazonEC2Client ec2 = new AmazonEC2Client(credentials, config);
You can also specify the region using the RegionEndpoint class. Here is an example that instantiates an
Amazon EC2 client using AWSClientFactory and specifies the region:
Amazon.Runtime.AWSCredentials credentials = new Amazon.Runtime.StoredPro
fileAWSCredentials("profile_name");
AmazonEC2Client ec2 = AWSClientFactory.CreateAmazonEC2Client(
credentials, RegionEndpoint.USEast1 );
Regions are isolated from each other. For example, you can't access US East resources when using the
EU West region. If your code needs access to multiple AWS regions, we recommend that you create a
client specific to each region.
Go to Regions and Endpoints in the AWS General Reference to view the current list of regions and
corresponding endpoints for each of the services offered by AWS.
Configuring Other Application Parameters
In addition to configuring credentials (p. 9), you can configure a number of other application parameters:
AWSEndpointDefinition (p. 14)
AWSLogging (p. 15)
AWSLogMetrics (p. 15)
AWSRegion (p. 16)
AWSResponseLogging (p. 16)
AWS.DynamoDBContext.TableNamePrefix (p. 17)
AWS.EC2.UseSignatureVersion4 (p. 17)
AWS.S3.UseSignatureVersion4 (p. 17)
These parameters can be configured in the application's .config file. Although you can also configure
these with the SDK for .NET API, we recommend that you use the application's .config file. Both
approaches are provided here.
For more information about use of the <aws> element as described later in this topic, see Configuration
Files Reference for AWS SDK for .NET (p. 18).
Additional Application Parameters
AWSEndpointDefinition
Configures whether the SDK should use a custom configuration file that defines the regions and
endpoints.
To set the endpoint definition file in the .config file, we recommend setting the
endpointDefinition attribute value in the <aws> element.
Version v2.0.0
14
AWS SDK for .NET Developer Guide
Additional Application Parameters