pingu
pingu

Reputation: 8827

specify a region when creating an Amazon AWS SQS queue in Ruby?

How can I specify a region when creating an Amazon AWS SQS queue in Ruby? the docs don't have anything to say on the subject.

Upvotes: 1

Views: 898

Answers (1)

Sam Starling
Sam Starling

Reputation: 5378

At the top of the SQS documentation for the Ruby SDK, it says you can set configuration "directly on the SQS interface". This means you can do something like this:

sqs = AWS::SQS.new(:region => 'us-east-1')
queue = sqs.queues.create("myqueue")

Alternatively, you can specify it globally using AWS.Config, like this:

AWS.config(
  :access_key_id => 'YOUR_ACCESS_KEY_ID',
  :secret_access_key => 'YOUR_SECRET_ACCESS_KEY',
  :region => 'us-east-1')

The documentation for configuration is here: http://docs.aws.amazon.com/AWSRubySDK/latest/AWS/Core/Configuration.html

Upvotes: 4

Related Questions