[AWS][C#][EC2]指定地區

| Comments

「You have 1 Amazon EC2 instance(s) running in the US-East (Northern Virginia) region.」

大家看了這段有沒有覺得很怪…明明就是有好幾個地區但在AWS SDK for .NET Documentation找的時候也找不到方法,只能找US-East地區的EC2,最後原來發現是要改這裡。

   1: AmazonEC2 ec2 = AWSClientFactory.CreateAmazonEC2Client(

   2:                 appConfig["AWSAccessKey"],

   3:                 appConfig["AWSSecretKey"], new AmazonEC2Config().WithServiceURL(https://ec2.ap-southeast-1.amazonaws.com);

只要在appConfig["AWSSecretKey"], 後面加上new AmazonEC2Config().WithServiceURL("地區位址")

  • 英國-https://ec2.eu-west-1.amazonaws.com

  • 美國(加州)-https://ec2.us-east-1.amazonaws.com
  • 亞太(東京)-https://ec2.ap-northeast-1.amazonaws.com
  • 美國(弗吉尼亞州)-https://ec2.us-west-1.amazonaws.com
  • 亞太(新加波)-https://ec2.ap-southeast-1.amazonaws.com
  • Comments