Search code examples
amazon-s3regionendpoint

How to set the EndPoint / Region for the C# .NET SDK : EC2Client?


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.


Solution

  • Regions and Endpoints can be found here.

    And example how to connect to EU:

    AmazonEC2 ec2 = AWSClientFactory.CreateAmazonEC2Client("key", "secret",
        new AmazonEC2Config
        {
            ServiceURL = "http://ec2.eu-west-1.amazonaws.com"
        }
    );