Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support New Regions and Endpoints File #1136

Merged
merged 14 commits into from
Apr 27, 2016
Merged

Conversation

awood45
Copy link
Member

@awood45 awood45 commented Mar 17, 2016

No description provided.

def get_partition(region)
RULES["partitions"].find do |p|
region.match(p["regionRegex"])
end
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The #get_partition method could own the logic of returning 'aws' as the default partion if the region does not match the regex of any known partition. This removes the need for the nil check above.

@mtdowling
Copy link
Member

Did you consider also utilizing the endpoint specific metadata for influencing the connection? For example, utilizing signaturerVersions, signing names, etc?

@trevorrowe trevorrowe force-pushed the regions-and-endpoints branch from 91c9876 to 738c5c0 Compare April 11, 2016 23:44
awood45 and others added 11 commits April 21, 2016 15:02
Work in progress migration to the new regions and endpoints file. Tests
are passing, and we appear to resolve regions correctly at this time.
Mainly relevant to the "s3-external-1" endpoint, but in theory could
apply for more service/region pairs in the future.
Use a valid region name for signing.
Additionally, supports switching the endpoints.json file to another
path.
Fixed a number of issues revealed in testing.
@trevorrowe trevorrowe force-pushed the regions-and-endpoints branch from 738c5c0 to 4b4eb55 Compare April 26, 2016 19:33
# Aws.partitions.each do |partition|
# puts partition.name
# end
#
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd love the "all everything in everywhere" example to be present, since that's a use case some have. For example:

Aws.partitions.each do |partition|
  partition.regions.each do |region|
    region.services.each do |service|
      # Do anything you'd want to do for all services in all regions.
      puts "#{service} is in #{region.name} in #{partition.name}"
    end
  end
end

@trevorrowe trevorrowe merged commit 4b77283 into master Apr 27, 2016
@trevorrowe trevorrowe deleted the regions-and-endpoints branch April 27, 2016 00:39
awood45 added a commit that referenced this pull request Apr 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants