Reputation: 185
I am very new in cloud computing world(including Amazon Web Service), so I have a very simple question:
Thanks!
Upvotes: 5
Views: 2302
Reputation: 37993
There's a better way to do it now that uses the Amazon.RegionEndpoint class rather than using a url string. The Visual Studio intellisense will give you all the regions.
AmazonSQS sqs = AWSClientFactory.CreateAmazonSQSClient(RegionEndpoint.USWest2);
Also, you don't need to pass the appConfig["AWSAccessKey"] in the parameters as long as you have it defined in the app.config. It'll find it.
Upvotes: 5
Reputation: 185
After a deep research I found the solution:
AmazonSQS sqs = AWSClientFactory.CreateAmazonSQSClient(
appConfig["AWSAccessKey"],
appConfig["AWSSecretKey"],
new AmazonSQSConfig().WithServiceURL("The url for wanted region")
);
The regions and urls are:
Source: http://aws.amazon.com/sqs/faqs/#What_is_the_EU_End-Point
Upvotes: 3