aws/aws-sdk-ruby — pull request #224 by trevorrowe (2013-04-11 17:08:34+00:00)
Title: Regions

Improved support for working regions.

## Configuring a Default region

`AWS.config` now accepts a `:region` option (defaults to 'us-east-1'). You can set this value globally or on a per service/client.

# set a new default region
AWS.config(:region => 'us-west-2')

# override the default region
ec2 = AWS::EC2.new(:region => 'us-west-1')

## Region and RegionCollection

You can now also use the new regions interface to get service objects:

ddb = AWS.regions['us-west-2'].dynamo_db
ddb.tables.map(&:name)

The regions collection object is enumerable as well:

AWS.regions.each.map(&:name)

You can access a region collection from service classes. These will only enumerate the regions the service operates in.

# get a full list of dynamo db tables, grouped by region
AWS::DynamoDB.regions.each do |region|
puts region.name
puts region.dynamo_db.tables.map(&:name)
puts ''
end

The old style endpoint configuration options are still supported. These should be considered *deprecated* and will likely be removed in the next major version (2.0).