Conversation
… the API documentation.
You can now specify what AWS region you want to connect to:
AWS.config(:region => 'us-west-2')
The individual configuration options for each service endpoints are
now deprecated. If you want to override the endpoint for a service
you can do so in the constructor:
AWS::S3.new(:region => 'us-east-1')
# this also works
AWS::S3.new(:endpoint => 's3-us-east-1.amazonaws.com')
Documentation changes were made to remove mention of the now
deprecated options.
You can get a region object using AWS.regions. This region
can be used as a shortcut for getting region specific clients.
east = AWS.regions['us-east-1']
west = AWS.regions['us-west-1']
east.ec2.instances.map(&:id)
west.ec2.instances.map(&:id)
You can also explore available regions using AWS.regions:
# makes a single (cached) http request to get a complete list of regions
AWS.regions.each do |region|
puts region.name
end
You can now enumerate the regions a specific service
is available in.
# generate a list of tables per region
AWS::DynamoDB.regions.each do |region|
puts regions.name
puts region.dynamo_db.tables.map(&:name)
puts ''
end
lsegal
added a commit
that referenced
this pull request
Apr 12, 2013
Add support for specifying regions, deprecate :SVC_endpoint option
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Improved support for working regions.
Configuring a Default region
AWS.confignow accepts a:regionoption (defaults to 'us-east-1'). You can set this value globally or on a per service/client.Region and RegionCollection
You can now also use the new regions interface to get service objects:
The regions collection object is enumerable as well:
You can access a region collection from service classes. These will only enumerate the regions the service operates in.
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).