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

Update AWS regions.yml #831

Merged
merged 1 commit into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 72 additions & 8 deletions config/regions.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
---
af-south-1:
:name: af-south-1
:hostname: ec2.af-south-1.amazonaws.com
:description: Africa (Cape Town)
ap-east-1:
:name: ap-east-1
:hostname: ec2.ap-east-1.amazonaws.com
Expand All @@ -14,11 +18,15 @@ ap-northeast-2:
ap-northeast-3:
:name: ap-northeast-3
:hostname: ec2.ap-northeast-3.amazonaws.com
:description: Asia Pacific (Osaka-Local)
:description: Asia Pacific (Osaka)
ap-south-1:
:name: ap-south-1
:hostname: ec2.ap-south-1.amazonaws.com
:description: Asia Pacific (Mumbai)
ap-south-2:
:name: ap-south-2
:hostname: ec2.ap-south-2.amazonaws.com
:description: Asia Pacific (Hyderabad)
ap-southeast-1:
:name: ap-southeast-1
:hostname: ec2.ap-southeast-1.amazonaws.com
Expand All @@ -27,34 +35,78 @@ ap-southeast-2:
:name: ap-southeast-2
:hostname: ec2.ap-southeast-2.amazonaws.com
:description: Asia Pacific (Sydney)
ap-southeast-3:
:name: ap-southeast-3
:hostname: ec2.ap-southeast-3.amazonaws.com
:description: Asia Pacific (Jakarta)
ap-southeast-4:
:name: ap-southeast-4
:hostname: ec2.ap-southeast-4.amazonaws.com
:description: Asia Pacific (Melbourne)
ca-central-1:
:name: ca-central-1
:hostname: ec2.ca-central-1.amazonaws.com
:description: Canada (Central)
eu-central-1:
:name: eu-central-1
:hostname: ec2.eu-central-1.amazonaws.com
:description: EU (Frankfurt)
:description: Europe (Frankfurt)
eu-central-2:
:name: eu-central-2
:hostname: ec2.eu-central-2.amazonaws.com
:description: Europe (Zurich)
eu-north-1:
:name: eu-north-1
:hostname: ec2.eu-north-1.amazonaws.com
:description: EU (Stockholm)
:description: Europe (Stockholm)
eu-south-1:
:name: eu-south-1
:hostname: ec2.eu-south-1.amazonaws.com
:description: EU (Milan)
:description: Europe (Milan)
eu-south-2:
:name: eu-south-2
:hostname: ec2.eu-south-2.amazonaws.com
:description: Europe (Spain)
eu-west-1:
:name: eu-west-1
:hostname: ec2.eu-west-1.amazonaws.com
:description: EU (Ireland)
:description: Europe (Ireland)
eu-west-2:
:name: eu-west-2
:hostname: ec2.eu-west-2.amazonaws.com
:description: EU (London)
:description: Europe (London)
eu-west-3:
:name: eu-west-3
:hostname: ec2.eu-west-3.amazonaws.com
:description: EU (Paris)
:description: Europe (Paris)
fips-ca-central-1:
:name: fips-ca-central-1
:hostname: ec2.fips-ca-central-1.amazonaws.com
:description: fips-ca-central-1
fips-us-east-1:
:name: fips-us-east-1
:hostname: ec2.fips-us-east-1.amazonaws.com
:description: fips-us-east-1
fips-us-east-2:
:name: fips-us-east-2
:hostname: ec2.fips-us-east-2.amazonaws.com
:description: fips-us-east-2
fips-us-west-1:
:name: fips-us-west-1
:hostname: ec2.fips-us-west-1.amazonaws.com
:description: fips-us-west-1
fips-us-west-2:
:name: fips-us-west-2
:hostname: ec2.fips-us-west-2.amazonaws.com
:description: fips-us-west-2
il-central-1:
:name: il-central-1
:hostname: ec2.il-central-1.amazonaws.com
:description: Israel (Tel Aviv)
me-central-1:
:name: me-central-1
:hostname: ec2.me-central-1.amazonaws.com
:description: Middle East (UAE)
me-south-1:
:name: me-south-1
:hostname: ec2.me-south-1.amazonaws.com
Expand Down Expand Up @@ -94,4 +146,16 @@ us-gov-east-1:
us-gov-west-1:
:name: us-gov-west-1
:hostname: ec2.us-gov-west-1.amazonaws.com
:description: AWS GovCloud (US)
:description: AWS GovCloud (US-West)
us-iso-east-1:
:name: us-iso-east-1
:hostname: ec2.us-iso-east-1.c2s.ic.gov
:description: US ISO East
us-iso-west-1:
:name: us-iso-west-1
:hostname: ec2.us-iso-west-1.c2s.ic.gov
:description: US ISO WEST
us-isob-east-1:
:name: us-isob-east-1
:hostname: ec2.us-isob-east-1.sc2s.sgov.gov
:description: US ISOB East (Ohio)
7 changes: 5 additions & 2 deletions lib/tasks_private/regions.rake
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,16 @@ namespace 'aws:extract' do
dns_suffix = partition['dnsSuffix']
regions_info = partition['regions']

partition['services'][service_name]['endpoints'].each_key do |region_name|
endpoints = partition.dig("services", service_name, "endpoints")
next if endpoints.nil?

endpoints.each_key do |region_name|
raise "Repetitive region name: #{region_name}" if memo.key?(region_name)

memo[region_name] = {
:name => region_name,
:hostname => "#{service_name}.#{region_name}.#{dns_suffix}",
:description => regions_info.fetch(region_name).fetch('description'),
:description => regions_info.dig(region_name, "description") || region_name
}.freeze
end
end
Expand Down
10 changes: 8 additions & 2 deletions spec/models/manageiq/providers/amazon/regions_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,13 @@

# https://docs.aws.amazon.com/general/latest/gr/rande.html - see quotes below
atypical_regions = [
'ap-northeast-3', # "To request access to the Asia Pacific (Osaka-Local) Region, contact..."
'ap-east-1', # "you must manually enable before you can use..."
'eu-south-1'
'ap-south-2',
'ap-southeast-3',
'ap-southeast-4',
'eu-central-2',
'eu-south-1',
'eu-south-2'
]

current_regions = described_class.regions.reject do |name, _config|
Expand All @@ -22,6 +26,8 @@
ems.connect.client.describe_regions.to_h[:regions]
end

online_regions.each { |r| r.delete(:opt_in_status) }

# sort for better diff
[current_regions, online_regions].each do |regions|
regions.map! { |r| r.sort.to_h }
Expand Down
72 changes: 50 additions & 22 deletions spec/vcr_cassettes/manageiq/providers/amazon/regions.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.