-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Conversation
def get_partition(region) | ||
RULES["partitions"].find do |p| | ||
region.match(p["regionRegex"]) | ||
end |
There was a problem hiding this comment.
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.
Did you consider also utilizing the endpoint specific metadata for influencing the connection? For example, utilizing signaturerVersions, signing names, etc? |
91c9876
to
738c5c0
Compare
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.
738c5c0
to
4b4eb55
Compare
# Aws.partitions.each do |partition| | ||
# puts partition.name | ||
# end | ||
# |
There was a problem hiding this comment.
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
No description provided.