In the JAVA SDK it's possible to set the endpoint, see here.
But how to do this for .NET SDK ? And what are the names to use?
Because it seems that a default endpoint "US East (Northern Virginia) Region" is always used.
To choose a default Region In the navigation bar choose your account name and then choose Settings to navigate to the Unified Settings page. Choose Edit next to Localization and default Region. Select your default Region, then choose Save changes.
To find your Regions using the consoleOpen the Amazon EC2 console at https://console.aws.amazon.com/ec2/ . From the navigation bar, view the options in the Region selector. Your EC2 resources for this Region are displayed on the EC2 Dashboard in the Resources section.
If you signed up for an AWS account on or after May 17, 2017, the default Region when you access a resource from the AWS Management Console is US East (Ohio) (us-east-2); for older accounts, the default Region is either US West (Oregon) (us-west-2) or US East (N. Virginia) (us-east-1).
An S3 bucket can be accessed through its URL. The URL format of a bucket is either of two options: http://s3.amazonaws.com/[bucket_name]/ http://[bucket_name].s3.amazonaws.com/
You can also use an endpoint definitions delivered with Amazon SDK:
var ec2Client = new AmazonEC2Client(RegionEndpoint.EUWest1);
Since I believe hard-coding such values as endpoint addresses is not a best practice I use more configurable version (i.e. endpoint configured from web.config/app.config):
var region = RegionEndpoint.GetBySystemName("eu-west-1");
var ec2Client = new AmazonEC2Client(region);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With