Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set the region on creating the Amazon SQS in C#

I am very new in cloud computing world(including Amazon Web Service), so I have a very simple question:

  • How do I set the region of a amazon sqs when I create it? The default region is "US-West (Northern California)".

Thanks!

like image 330
Cargo Avatar asked Nov 02 '10 14:11

Cargo


People also ask

How do I specify AWS 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.

Is SQS region based?

SQS is a regional service, that is highly available within a single region. There is no cross-region replication capability.

Can SQS Cross-region?

Amazon SNS supports the cross-region delivery of notifications to Amazon SQS queues and to AWS Lambda functions. When one of the Regions is an opt-in Region, you must specify a different Amazon SNS service principal in the subscribed resource's policy.

How do I find my AWS region?

To find your Regions using the consoleOpen the Amazon EC2 console at https://console.aws.amazon.com/ec2/ . From the navigation bar, choose the Regions selector. Your EC2 resources for this Region are displayed on the EC2 Dashboard in the Resources section.


1 Answers

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.

like image 195
wisbucky Avatar answered Sep 24 '22 14:09

wisbucky