aws-partitions 1.650.0 → 1.651.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/VERSION +1 -1
- data/lib/aws-partitions/partition.rb +10 -2
- data/lib/aws-partitions/partition_list.rb +50 -0
- data/lib/aws-partitions.rb +21 -1
- data/partitions-metadata.json +101 -0
- data/partitions.json +9 -0
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: dcc02d873496276ad8043f41ae1658b2afdf0a332ce99b05ff48989894b510a2
|
|
4
|
+
data.tar.gz: 0ef2a04a36a4b808b96d0d76ad952c7af100ce3d3cfea5e86e7bc8384e55cb51
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 575a2c637da0bcb4ea6ed4759a206de6d60531ea0fbce46f7cecb4ce5a71ba7771532569856f26b4fd06b2538b169fab8bd450662edef5295dbd2cda5e997f96
|
|
7
|
+
data.tar.gz: 4d055f5cf07168316c2099c8506ff9476625128e11a7c37eb4152f48e8b673030aae283d5e593b9672d1cbddfe04f384534b75586c578186cddc77005ef608c0
|
data/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
Unreleased Changes
|
|
2
2
|
------------------
|
|
3
3
|
|
|
4
|
+
1.651.0 (2022-10-25)
|
|
5
|
+
------------------
|
|
6
|
+
|
|
7
|
+
* Feature - Updated the partitions source data the determines the AWS service regions and endpoints.
|
|
8
|
+
|
|
9
|
+
* Feature - Add a metadata method to `Partition` to supplement endpoint generation in service gems.
|
|
10
|
+
|
|
4
11
|
1.650.0 (2022-10-24)
|
|
5
12
|
------------------
|
|
6
13
|
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.
|
|
1
|
+
1.651.0
|
|
@@ -10,12 +10,20 @@ module Aws
|
|
|
10
10
|
def initialize(options = {})
|
|
11
11
|
@name = options[:name]
|
|
12
12
|
@regions = options[:regions]
|
|
13
|
+
@region_regex = options[:region_regex]
|
|
13
14
|
@services = options[:services]
|
|
15
|
+
@metadata = options[:metadata]
|
|
14
16
|
end
|
|
15
17
|
|
|
16
18
|
# @return [String] The partition name, e.g. "aws", "aws-cn", "aws-us-gov".
|
|
17
19
|
attr_reader :name
|
|
18
20
|
|
|
21
|
+
# @return [String] The regex representing the region format.
|
|
22
|
+
attr_reader :region_regex
|
|
23
|
+
|
|
24
|
+
# @return [Metadata] The metadata for the partition.
|
|
25
|
+
attr_reader :metadata
|
|
26
|
+
|
|
19
27
|
# @param [String] region_name The name of the region, e.g. "us-east-1".
|
|
20
28
|
# @return [Region]
|
|
21
29
|
# @raise [ArgumentError] Raises `ArgumentError` for unknown region name.
|
|
@@ -70,6 +78,7 @@ module Aws
|
|
|
70
78
|
Partition.new(
|
|
71
79
|
name: partition['partition'],
|
|
72
80
|
regions: build_regions(partition),
|
|
81
|
+
region_regex: partition['regionRegex'],
|
|
73
82
|
services: build_services(partition)
|
|
74
83
|
)
|
|
75
84
|
end
|
|
@@ -79,8 +88,7 @@ module Aws
|
|
|
79
88
|
# @param [Hash] partition
|
|
80
89
|
# @return [Hash<String,Region>]
|
|
81
90
|
def build_regions(partition)
|
|
82
|
-
partition['regions'].each_with_object({}) do
|
|
83
|
-
|(region_name, region), regions|
|
|
91
|
+
partition['regions'].each_with_object({}) do |(region_name, region), regions|
|
|
84
92
|
next if region_name == "#{partition['partition']}-global"
|
|
85
93
|
|
|
86
94
|
regions[region_name] = Region.build(
|
|
@@ -42,12 +42,62 @@ module Aws
|
|
|
42
42
|
end
|
|
43
43
|
end
|
|
44
44
|
|
|
45
|
+
# @param [Partition] partition
|
|
46
|
+
# @api private
|
|
47
|
+
def merge_metadata(partitions_metadata)
|
|
48
|
+
partitions_metadata['partitions'].each do |partition_metadata|
|
|
49
|
+
outputs = partition_metadata['outputs']
|
|
50
|
+
|
|
51
|
+
if existing = @partitions[partition_metadata['id']]
|
|
52
|
+
@partitions[partition_metadata['id']] = Partition.new(
|
|
53
|
+
name: existing.name,
|
|
54
|
+
regions: build_metadata_regions(
|
|
55
|
+
partition_metadata['id'],
|
|
56
|
+
partition_metadata['regions'],
|
|
57
|
+
existing),
|
|
58
|
+
region_regex: partition_metadata['regionRegex'],
|
|
59
|
+
services: existing.services.each_with_object({}) do |s, services|
|
|
60
|
+
services[s.name] = s
|
|
61
|
+
end,
|
|
62
|
+
metadata: outputs
|
|
63
|
+
)
|
|
64
|
+
else
|
|
65
|
+
@partitions[partition_metadata['id']] = Partition.new(
|
|
66
|
+
name: partition_metadata['id'],
|
|
67
|
+
regions: build_metadata_regions(
|
|
68
|
+
partition_metadata['id'], partition_metadata['regions']
|
|
69
|
+
),
|
|
70
|
+
region_regex: partition_metadata['regionRegex'],
|
|
71
|
+
services: {},
|
|
72
|
+
metadata: outputs
|
|
73
|
+
)
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
|
|
45
78
|
# Removed all partitions.
|
|
46
79
|
# @api private
|
|
47
80
|
def clear
|
|
48
81
|
@partitions = {}
|
|
49
82
|
end
|
|
50
83
|
|
|
84
|
+
private
|
|
85
|
+
|
|
86
|
+
def build_metadata_regions(partition_name, metadata_regions, existing = nil)
|
|
87
|
+
metadata_regions.each_with_object({}) do |(region_name, region), regions|
|
|
88
|
+
if existing && existing.region?(region_name)
|
|
89
|
+
regions[region_name] = existing.region(region_name)
|
|
90
|
+
else
|
|
91
|
+
regions[region_name] = Region.new(
|
|
92
|
+
name: region_name,
|
|
93
|
+
description: region['description'],
|
|
94
|
+
partition_name: partition_name,
|
|
95
|
+
services: Set.new
|
|
96
|
+
)
|
|
97
|
+
end
|
|
98
|
+
end
|
|
99
|
+
end
|
|
100
|
+
|
|
51
101
|
class << self
|
|
52
102
|
|
|
53
103
|
# @api private
|
data/lib/aws-partitions.rb
CHANGED
|
@@ -195,6 +195,12 @@ module Aws
|
|
|
195
195
|
end
|
|
196
196
|
end
|
|
197
197
|
|
|
198
|
+
# @param [Hash] partition metadata
|
|
199
|
+
# @api private For Internal use only
|
|
200
|
+
def merge_metadata(partition_metadata)
|
|
201
|
+
default_partition_list.merge_metadata(partition_metadata)
|
|
202
|
+
end
|
|
203
|
+
|
|
198
204
|
# @api private For internal use only.
|
|
199
205
|
def clear
|
|
200
206
|
default_partition_list.clear
|
|
@@ -204,7 +210,11 @@ module Aws
|
|
|
204
210
|
# @return [PartitionList]
|
|
205
211
|
# @api private
|
|
206
212
|
def default_partition_list
|
|
207
|
-
@default_partition_list ||=
|
|
213
|
+
@default_partition_list ||= begin
|
|
214
|
+
partitions = PartitionList.build(defaults)
|
|
215
|
+
partitions.merge_metadata(default_metadata)
|
|
216
|
+
partitions
|
|
217
|
+
end
|
|
208
218
|
end
|
|
209
219
|
|
|
210
220
|
# @return [Hash]
|
|
@@ -217,6 +227,16 @@ module Aws
|
|
|
217
227
|
end
|
|
218
228
|
end
|
|
219
229
|
|
|
230
|
+
# @return [Hash]
|
|
231
|
+
# @api private
|
|
232
|
+
def default_metadata
|
|
233
|
+
@default_metadata ||= begin
|
|
234
|
+
path = File.expand_path('../../partitions-metadata.json', __FILE__)
|
|
235
|
+
defaults = JSON.parse(File.read(path), freeze: true)
|
|
236
|
+
defaults.merge('partitions' => defaults['partitions'].dup)
|
|
237
|
+
end
|
|
238
|
+
end
|
|
239
|
+
|
|
220
240
|
# @return [Hash<String,String>] Returns a map of service module names
|
|
221
241
|
# to their id as used in the endpoints.json document.
|
|
222
242
|
# @api private For internal use only.
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "1.1",
|
|
3
|
+
"partitions": [
|
|
4
|
+
{
|
|
5
|
+
"id": "aws",
|
|
6
|
+
"regionRegex": "^(us|eu|ap|sa|ca|me|af)-\\w+-\\d+$",
|
|
7
|
+
"regions": {
|
|
8
|
+
"af-south-1": {},
|
|
9
|
+
"af-east-1": {},
|
|
10
|
+
"ap-northeast-1": {},
|
|
11
|
+
"ap-northeast-2": {},
|
|
12
|
+
"ap-northeast-3": {},
|
|
13
|
+
"ap-south-1": {},
|
|
14
|
+
"ap-southeast-1": {},
|
|
15
|
+
"ap-southeast-2": {},
|
|
16
|
+
"ap-southeast-3": {},
|
|
17
|
+
"ca-central-1": {},
|
|
18
|
+
"eu-central-1": {},
|
|
19
|
+
"eu-north-1": {},
|
|
20
|
+
"eu-south-1": {},
|
|
21
|
+
"eu-west-1": {},
|
|
22
|
+
"eu-west-2": {},
|
|
23
|
+
"eu-west-3": {},
|
|
24
|
+
"me-south-1": {},
|
|
25
|
+
"sa-east-1": {},
|
|
26
|
+
"us-east-1": {},
|
|
27
|
+
"us-east-2": {},
|
|
28
|
+
"us-west-1": {},
|
|
29
|
+
"us-west-2": {},
|
|
30
|
+
"aws-global": {}
|
|
31
|
+
},
|
|
32
|
+
"outputs": {
|
|
33
|
+
"name": "aws",
|
|
34
|
+
"dnsSuffix": "amazonaws.com",
|
|
35
|
+
"dualStackDnsSuffix": "api.aws",
|
|
36
|
+
"supportsFIPS": true,
|
|
37
|
+
"supportsDualStack": true
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"id": "aws-us-gov",
|
|
42
|
+
"regionRegex": "^us\\-gov\\-\\w+\\-\\d+$",
|
|
43
|
+
"regions": {
|
|
44
|
+
"us-gov-west-1": {},
|
|
45
|
+
"us-gov-east-1": {},
|
|
46
|
+
"aws-us-gov-global": {}
|
|
47
|
+
},
|
|
48
|
+
"outputs": {
|
|
49
|
+
"name": "aws-us-gov",
|
|
50
|
+
"dnsSuffix": "amazonaws.com",
|
|
51
|
+
"dualStackDnsSuffix": "api.aws",
|
|
52
|
+
"supportsFIPS": true,
|
|
53
|
+
"supportsDualStack": true
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"id": "aws-cn",
|
|
58
|
+
"regionRegex": "^cn\\-\\w+\\-\\d+$",
|
|
59
|
+
"regions": {
|
|
60
|
+
"cn-north-1": {},
|
|
61
|
+
"cn-northwest-1": {},
|
|
62
|
+
"aws-cn-global": {}
|
|
63
|
+
},
|
|
64
|
+
"outputs": {
|
|
65
|
+
"name": "aws-cn",
|
|
66
|
+
"dnsSuffix": "amazonaws.com.cn",
|
|
67
|
+
"dualStackDnsSuffix": "api.amazonwebservices.com.cn",
|
|
68
|
+
"supportsFIPS": true,
|
|
69
|
+
"supportsDualStack": true
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"id": "aws-iso",
|
|
74
|
+
"regionRegex": "^us\\-iso\\-\\w+\\-\\d+$",
|
|
75
|
+
"outputs": {
|
|
76
|
+
"name": "aws-iso",
|
|
77
|
+
"dnsSuffix": "c2s.ic.gov",
|
|
78
|
+
"supportsFIPS": true,
|
|
79
|
+
"supportsDualStack": false,
|
|
80
|
+
"dualStackDnsSuffix": "c2s.ic.gov"
|
|
81
|
+
},
|
|
82
|
+
"regions": {
|
|
83
|
+
"aws-iso-global": {}
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"id": "aws-iso-b",
|
|
88
|
+
"regionRegex": "^us\\-isob\\-\\w+\\-\\d+$",
|
|
89
|
+
"outputs": {
|
|
90
|
+
"name": "aws-iso-b",
|
|
91
|
+
"dnsSuffix": "sc2s.sgov.gov",
|
|
92
|
+
"supportsFIPS": true,
|
|
93
|
+
"supportsDualStack": false,
|
|
94
|
+
"dualStackDnsSuffix": "sc2s.sgov.gov"
|
|
95
|
+
},
|
|
96
|
+
"regions": {
|
|
97
|
+
"aws-iso-b-global": {}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
]
|
|
101
|
+
}
|
data/partitions.json
CHANGED
|
@@ -3496,6 +3496,7 @@
|
|
|
3496
3496
|
"deprecated" : true,
|
|
3497
3497
|
"hostname" : "data.iot-fips.us-west-2.amazonaws.com"
|
|
3498
3498
|
},
|
|
3499
|
+
"me-central-1" : { },
|
|
3499
3500
|
"me-south-1" : { },
|
|
3500
3501
|
"sa-east-1" : { },
|
|
3501
3502
|
"us-east-1" : {
|
|
@@ -7246,6 +7247,7 @@
|
|
|
7246
7247
|
"deprecated" : true,
|
|
7247
7248
|
"hostname" : "iot-fips.us-west-2.amazonaws.com"
|
|
7248
7249
|
},
|
|
7250
|
+
"me-central-1" : { },
|
|
7249
7251
|
"me-south-1" : { },
|
|
7250
7252
|
"sa-east-1" : { },
|
|
7251
7253
|
"us-east-1" : {
|
|
@@ -10529,6 +10531,7 @@
|
|
|
10529
10531
|
"deprecated" : true,
|
|
10530
10532
|
"hostname" : "ram-fips.us-west-2.amazonaws.com"
|
|
10531
10533
|
},
|
|
10534
|
+
"me-central-1" : { },
|
|
10532
10535
|
"me-south-1" : { },
|
|
10533
10536
|
"sa-east-1" : { },
|
|
10534
10537
|
"us-east-1" : {
|
|
@@ -15058,6 +15061,12 @@
|
|
|
15058
15061
|
"fips-us-west-2" : {
|
|
15059
15062
|
"deprecated" : true
|
|
15060
15063
|
},
|
|
15064
|
+
"ui-ap-northeast-1" : { },
|
|
15065
|
+
"ui-ap-southeast-2" : { },
|
|
15066
|
+
"ui-eu-central-1" : { },
|
|
15067
|
+
"ui-eu-west-2" : { },
|
|
15068
|
+
"ui-us-east-1" : { },
|
|
15069
|
+
"ui-us-west-2" : { },
|
|
15061
15070
|
"us-east-1" : {
|
|
15062
15071
|
"variants" : [ {
|
|
15063
15072
|
"tags" : [ "fips" ]
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: aws-partitions
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.651.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Amazon Web Services
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2022-10-
|
|
11
|
+
date: 2022-10-25 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: Provides interfaces to enumerate AWS partitions, regions, and services.
|
|
14
14
|
email:
|
|
@@ -25,6 +25,7 @@ files:
|
|
|
25
25
|
- lib/aws-partitions/partition_list.rb
|
|
26
26
|
- lib/aws-partitions/region.rb
|
|
27
27
|
- lib/aws-partitions/service.rb
|
|
28
|
+
- partitions-metadata.json
|
|
28
29
|
- partitions.json
|
|
29
30
|
homepage: https://github.com/aws/aws-sdk-ruby
|
|
30
31
|
licenses:
|