Sunday, November 19, 2017

How to change AWS SDK region in code?

It is the best practice to use more configurable version (i.e. endpoint configured from web.config/app.config). For EC2 client, you can do it by the following way:
var region = RegionEndpoint.GetBySystemName("ap-northeast-1"); 
var awsEC2Client = new AmazonEC2Client(region);
For others reason, you can specify from here

Resource Link:

  1. How to set the EndPoint / Region for the C# .NET SDK : EC2Client?
  2. How to start an Amazon EC2 instance programmatically in .NET
Resource Link: https://stackoverflow.com/a/41468147/2293534

No comments:

Post a Comment