aws-partitions 1.150.0 → 1.356.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/aws-partitions.rb +57 -1
- data/lib/aws-partitions/endpoint_provider.rb +69 -43
- data/lib/aws-partitions/partition.rb +34 -21
- data/lib/aws-partitions/partition_list.rb +4 -2
- data/lib/aws-partitions/region.rb +2 -0
- data/lib/aws-partitions/service.rb +3 -1
- data/partitions.json +6375 -1277
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 6e36769e4a13e1604546c5cfdb23bf23b104868e7dcbb89040b307c75cf5a1af
|
4
|
+
data.tar.gz: e23a416fca8baa16079a98e7129e6c550c4a7f9c0cb79eba6fa2b830c5c7bbff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5abd6a48ddbc73b434cf1f34e9420efbab24033fc8fcb78672950678ec6a4bc90bbae6acfe84e660730052a987d340d17b402026e6025f78523e2c7f8e1bf140
|
7
|
+
data.tar.gz: c50aff087f65f488c7f20d6ca9850a3df182592e8cba62070bbf893373bc6d13fd836d438426c2c7aca58a8d0a91529bc675bbea58b1a635cbee4a82424f57b2
|
data/lib/aws-partitions.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require_relative 'aws-partitions/endpoint_provider'
|
2
4
|
require_relative 'aws-partitions/partition'
|
3
5
|
require_relative 'aws-partitions/partition_list'
|
@@ -224,20 +226,25 @@ module Aws
|
|
224
226
|
'ACM' => 'acm',
|
225
227
|
'ACMPCA' => 'acm-pca',
|
226
228
|
'APIGateway' => 'apigateway',
|
229
|
+
'AccessAnalyzer' => 'access-analyzer',
|
227
230
|
'AlexaForBusiness' => 'a4b',
|
228
231
|
'Amplify' => 'amplify',
|
229
232
|
'ApiGatewayManagementApi' => 'execute-api',
|
230
233
|
'ApiGatewayV2' => 'apigateway',
|
234
|
+
'AppConfig' => 'appconfig',
|
231
235
|
'AppMesh' => 'appmesh',
|
232
236
|
'AppStream' => 'appstream2',
|
233
237
|
'AppSync' => 'appsync',
|
234
238
|
'ApplicationAutoScaling' => 'application-autoscaling',
|
235
239
|
'ApplicationDiscoveryService' => 'discovery',
|
240
|
+
'ApplicationInsights' => 'applicationinsights',
|
236
241
|
'Athena' => 'athena',
|
242
|
+
'AugmentedAIRuntime' => 'a2i-runtime.sagemaker',
|
237
243
|
'AutoScaling' => 'autoscaling',
|
238
|
-
'AutoScalingPlans' => 'autoscaling',
|
244
|
+
'AutoScalingPlans' => 'autoscaling-plans',
|
239
245
|
'Backup' => 'backup',
|
240
246
|
'Batch' => 'batch',
|
247
|
+
'Braket' => 'braket',
|
241
248
|
'Budgets' => 'budgets',
|
242
249
|
'Chime' => 'chime',
|
243
250
|
'Cloud9' => 'cloud9',
|
@@ -251,32 +258,43 @@ module Aws
|
|
251
258
|
'CloudWatch' => 'monitoring',
|
252
259
|
'CloudWatchEvents' => 'events',
|
253
260
|
'CloudWatchLogs' => 'logs',
|
261
|
+
'CodeArtifact' => 'codeartifact',
|
254
262
|
'CodeBuild' => 'codebuild',
|
255
263
|
'CodeCommit' => 'codecommit',
|
256
264
|
'CodeDeploy' => 'codedeploy',
|
265
|
+
'CodeGuruProfiler' => 'codeguru-profiler',
|
266
|
+
'CodeGuruReviewer' => 'codeguru-reviewer',
|
257
267
|
'CodePipeline' => 'codepipeline',
|
258
268
|
'CodeStar' => 'codestar',
|
269
|
+
'CodeStarNotifications' => 'codestar-notifications',
|
270
|
+
'CodeStarconnections' => 'codestar-connections',
|
259
271
|
'CognitoIdentity' => 'cognito-identity',
|
260
272
|
'CognitoIdentityProvider' => 'cognito-idp',
|
261
273
|
'CognitoSync' => 'cognito-sync',
|
262
274
|
'Comprehend' => 'comprehend',
|
263
275
|
'ComprehendMedical' => 'comprehendmedical',
|
276
|
+
'ComputeOptimizer' => 'compute-optimizer',
|
264
277
|
'ConfigService' => 'config',
|
265
278
|
'Connect' => 'connect',
|
279
|
+
'ConnectParticipant' => 'participant.connect',
|
266
280
|
'CostExplorer' => 'ce',
|
267
281
|
'CostandUsageReportService' => 'cur',
|
268
282
|
'DAX' => 'dax',
|
269
283
|
'DLM' => 'dlm',
|
284
|
+
'DataExchange' => 'dataexchange',
|
270
285
|
'DataPipeline' => 'datapipeline',
|
271
286
|
'DataSync' => 'datasync',
|
272
287
|
'DatabaseMigrationService' => 'dms',
|
288
|
+
'Detective' => 'api.detective',
|
273
289
|
'DeviceFarm' => 'devicefarm',
|
274
290
|
'DirectConnect' => 'directconnect',
|
275
291
|
'DirectoryService' => 'ds',
|
276
292
|
'DocDB' => 'rds',
|
277
293
|
'DynamoDB' => 'dynamodb',
|
278
294
|
'DynamoDBStreams' => 'streams.dynamodb',
|
295
|
+
'EBS' => 'ebs',
|
279
296
|
'EC2' => 'ec2',
|
297
|
+
'EC2InstanceConnect' => 'ec2-instance-connect',
|
280
298
|
'ECR' => 'api.ecr',
|
281
299
|
'ECS' => 'ecs',
|
282
300
|
'EFS' => 'elasticfilesystem',
|
@@ -284,36 +302,53 @@ module Aws
|
|
284
302
|
'EMR' => 'elasticmapreduce',
|
285
303
|
'ElastiCache' => 'elasticache',
|
286
304
|
'ElasticBeanstalk' => 'elasticbeanstalk',
|
305
|
+
'ElasticInference' => 'api.elastic-inference',
|
287
306
|
'ElasticLoadBalancing' => 'elasticloadbalancing',
|
288
307
|
'ElasticLoadBalancingV2' => 'elasticloadbalancing',
|
289
308
|
'ElasticTranscoder' => 'elastictranscoder',
|
290
309
|
'ElasticsearchService' => 'es',
|
310
|
+
'EventBridge' => 'events',
|
291
311
|
'FMS' => 'fms',
|
292
312
|
'FSx' => 'fsx',
|
293
313
|
'Firehose' => 'firehose',
|
314
|
+
'ForecastQueryService' => 'forecastquery',
|
315
|
+
'ForecastService' => 'forecast',
|
316
|
+
'FraudDetector' => 'frauddetector',
|
294
317
|
'GameLift' => 'gamelift',
|
295
318
|
'Glacier' => 'glacier',
|
296
319
|
'GlobalAccelerator' => 'globalaccelerator',
|
297
320
|
'Glue' => 'glue',
|
298
321
|
'Greengrass' => 'greengrass',
|
322
|
+
'GroundStation' => 'groundstation',
|
299
323
|
'GuardDuty' => 'guardduty',
|
300
324
|
'Health' => 'health',
|
325
|
+
'Honeycode' => 'honeycode',
|
301
326
|
'IAM' => 'iam',
|
327
|
+
'IVS' => 'ivs',
|
328
|
+
'Imagebuilder' => 'imagebuilder',
|
302
329
|
'ImportExport' => 'importexport',
|
303
330
|
'Inspector' => 'inspector',
|
304
331
|
'IoT' => 'iot',
|
305
332
|
'IoT1ClickDevicesService' => 'devices.iot1click',
|
306
333
|
'IoT1ClickProjects' => 'projects.iot1click',
|
307
334
|
'IoTAnalytics' => 'iotanalytics',
|
335
|
+
'IoTEvents' => 'iotevents',
|
336
|
+
'IoTEventsData' => 'data.iotevents',
|
308
337
|
'IoTJobsDataPlane' => 'data.jobs.iot',
|
338
|
+
'IoTSecureTunneling' => 'api.tunneling.iot',
|
339
|
+
'IoTSiteWise' => 'iotsitewise',
|
340
|
+
'IoTThingsGraph' => 'iotthingsgraph',
|
309
341
|
'KMS' => 'kms',
|
310
342
|
'Kafka' => 'kafka',
|
343
|
+
'Kendra' => 'kendra',
|
311
344
|
'Kinesis' => 'kinesis',
|
312
345
|
'KinesisAnalytics' => 'kinesisanalytics',
|
313
346
|
'KinesisAnalyticsV2' => 'kinesisanalytics',
|
314
347
|
'KinesisVideo' => 'kinesisvideo',
|
315
348
|
'KinesisVideoArchivedMedia' => 'kinesisvideo',
|
316
349
|
'KinesisVideoMedia' => 'kinesisvideo',
|
350
|
+
'KinesisVideoSignalingChannels' => 'kinesisvideo',
|
351
|
+
'LakeFormation' => 'lakeformation',
|
317
352
|
'Lambda' => 'lambda',
|
318
353
|
'LambdaPreview' => 'lambda',
|
319
354
|
'Lex' => 'runtime.lex',
|
@@ -324,6 +359,9 @@ module Aws
|
|
324
359
|
'MTurk' => 'mturk-requester',
|
325
360
|
'MachineLearning' => 'machinelearning',
|
326
361
|
'Macie' => 'macie',
|
362
|
+
'Macie2' => 'macie2',
|
363
|
+
'ManagedBlockchain' => 'managedblockchain',
|
364
|
+
'MarketplaceCatalog' => 'catalog.marketplace',
|
327
365
|
'MarketplaceCommerceAnalytics' => 'marketplacecommerceanalytics',
|
328
366
|
'MarketplaceEntitlementService' => 'entitlement.marketplace',
|
329
367
|
'MarketplaceMetering' => 'metering.marketplace',
|
@@ -331,21 +369,30 @@ module Aws
|
|
331
369
|
'MediaConvert' => 'mediaconvert',
|
332
370
|
'MediaLive' => 'medialive',
|
333
371
|
'MediaPackage' => 'mediapackage',
|
372
|
+
'MediaPackageVod' => 'mediapackage-vod',
|
334
373
|
'MediaStore' => 'mediastore',
|
335
374
|
'MediaStoreData' => 'data.mediastore',
|
336
375
|
'MediaTailor' => 'api.mediatailor',
|
337
376
|
'MigrationHub' => 'mgh',
|
377
|
+
'MigrationHubConfig' => 'migrationhub-config',
|
338
378
|
'Mobile' => 'mobile',
|
339
379
|
'Neptune' => 'rds',
|
380
|
+
'NetworkManager' => 'networkmanager',
|
340
381
|
'OpsWorks' => 'opsworks',
|
341
382
|
'OpsWorksCM' => 'opsworks-cm',
|
342
383
|
'Organizations' => 'organizations',
|
384
|
+
'Outposts' => 'outposts',
|
343
385
|
'PI' => 'pi',
|
386
|
+
'Personalize' => 'personalize',
|
387
|
+
'PersonalizeEvents' => 'personalize-events',
|
388
|
+
'PersonalizeRuntime' => 'personalize-runtime',
|
344
389
|
'Pinpoint' => 'pinpoint',
|
345
390
|
'PinpointEmail' => 'email',
|
346
391
|
'PinpointSMSVoice' => 'sms-voice.pinpoint',
|
347
392
|
'Polly' => 'polly',
|
348
393
|
'Pricing' => 'api.pricing',
|
394
|
+
'QLDB' => 'qldb',
|
395
|
+
'QLDBSession' => 'session.qldb',
|
349
396
|
'QuickSight' => 'quicksight',
|
350
397
|
'RAM' => 'ram',
|
351
398
|
'RDS' => 'rds',
|
@@ -361,19 +408,25 @@ module Aws
|
|
361
408
|
'S3' => 's3',
|
362
409
|
'S3Control' => 's3-control',
|
363
410
|
'SES' => 'email',
|
411
|
+
'SESV2' => 'email',
|
364
412
|
'SMS' => 'sms',
|
365
413
|
'SNS' => 'sns',
|
366
414
|
'SQS' => 'sqs',
|
367
415
|
'SSM' => 'ssm',
|
416
|
+
'SSO' => 'portal.sso',
|
417
|
+
'SSOOIDC' => 'oidc',
|
368
418
|
'STS' => 'sts',
|
369
419
|
'SWF' => 'swf',
|
370
420
|
'SageMaker' => 'api.sagemaker',
|
371
421
|
'SageMakerRuntime' => 'runtime.sagemaker',
|
422
|
+
'SavingsPlans' => 'savingsplans',
|
423
|
+
'Schemas' => 'schemas',
|
372
424
|
'SecretsManager' => 'secretsmanager',
|
373
425
|
'SecurityHub' => 'securityhub',
|
374
426
|
'ServerlessApplicationRepository' => 'serverlessrepo',
|
375
427
|
'ServiceCatalog' => 'servicecatalog',
|
376
428
|
'ServiceDiscovery' => 'servicediscovery',
|
429
|
+
'ServiceQuotas' => 'servicequotas',
|
377
430
|
'Shield' => 'shield',
|
378
431
|
'Signer' => 'signer',
|
379
432
|
'SimpleDB' => 'sdb',
|
@@ -381,6 +434,7 @@ module Aws
|
|
381
434
|
'States' => 'states',
|
382
435
|
'StorageGateway' => 'storagegateway',
|
383
436
|
'Support' => 'support',
|
437
|
+
'Synthetics' => 'synthetics',
|
384
438
|
'Textract' => 'textract',
|
385
439
|
'TranscribeService' => 'transcribe',
|
386
440
|
'TranscribeStreamingService' => 'transcribestreaming',
|
@@ -388,9 +442,11 @@ module Aws
|
|
388
442
|
'Translate' => 'translate',
|
389
443
|
'WAF' => 'waf',
|
390
444
|
'WAFRegional' => 'waf-regional',
|
445
|
+
'WAFV2' => 'wafv2',
|
391
446
|
'WorkDocs' => 'workdocs',
|
392
447
|
'WorkLink' => 'worklink',
|
393
448
|
'WorkMail' => 'workmail',
|
449
|
+
'WorkMailMessageFlow' => 'workmailmessageflow',
|
394
450
|
'WorkSpaces' => 'workspaces',
|
395
451
|
'XRay' => 'xray',
|
396
452
|
}
|
@@ -1,7 +1,29 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Aws
|
2
4
|
module Partitions
|
3
5
|
# @api private
|
4
6
|
class EndpointProvider
|
7
|
+
# When sts_regional_endpoint is set to `legacy`, the endpoint
|
8
|
+
# pattern stays global for the following regions:
|
9
|
+
STS_LEGACY_REGIONS = %w[
|
10
|
+
ap-northeast-1
|
11
|
+
ap-south-1
|
12
|
+
ap-southeast-1
|
13
|
+
ap-southeast-2
|
14
|
+
aws-global
|
15
|
+
ca-central-1
|
16
|
+
eu-central-1
|
17
|
+
eu-north-1
|
18
|
+
eu-west-1
|
19
|
+
eu-west-2
|
20
|
+
eu-west-3
|
21
|
+
sa-east-1
|
22
|
+
us-east-1
|
23
|
+
us-east-2
|
24
|
+
us-west-1
|
25
|
+
us-west-2
|
26
|
+
].freeze
|
5
27
|
|
6
28
|
# Intentionally marked private. The format of the endpoint rules
|
7
29
|
# is an implementation detail.
|
@@ -10,65 +32,69 @@ module Aws
|
|
10
32
|
@rules = rules
|
11
33
|
end
|
12
34
|
|
13
|
-
# @param [String] region
|
14
|
-
# @param [String] service The endpoint prefix for the service, e.g.
|
15
|
-
# cloudwatch.
|
35
|
+
# @param [String] region The region for the client.
|
36
|
+
# @param [String] service The endpoint prefix for the service, e.g.
|
37
|
+
# "monitoring" for cloudwatch.
|
38
|
+
# @param [String] sts_regional_endpoints [STS only] Whether to use
|
39
|
+
# `legacy` (global endpoint for legacy regions) or `regional` mode for
|
40
|
+
# using regional endpoint for supported regions except 'aws-global'
|
16
41
|
# @api private Use the static class methods instead.
|
17
|
-
def resolve(region, service)
|
18
|
-
|
42
|
+
def resolve(region, service, sts_regional_endpoints)
|
43
|
+
'https://' + endpoint_for(region, service, sts_regional_endpoints)
|
19
44
|
end
|
20
45
|
|
21
46
|
# @api private Use the static class methods instead.
|
22
47
|
def signing_region(region, service)
|
23
|
-
get_partition(region)
|
24
|
-
fetch(
|
25
|
-
fetch(service, {})
|
26
|
-
fetch(
|
27
|
-
fetch(region, {})
|
28
|
-
fetch(
|
29
|
-
fetch(
|
48
|
+
get_partition(region)
|
49
|
+
.fetch('services', {})
|
50
|
+
.fetch(service, {})
|
51
|
+
.fetch('endpoints', {})
|
52
|
+
.fetch(region, {})
|
53
|
+
.fetch('credentialScope', {})
|
54
|
+
.fetch('region', region)
|
30
55
|
end
|
31
56
|
|
32
57
|
# @api private Use the static class methods instead.
|
33
58
|
def dns_suffix_for(region)
|
34
|
-
|
35
|
-
partition['dnsSuffix']
|
59
|
+
get_partition(region)['dnsSuffix']
|
36
60
|
end
|
37
61
|
|
38
62
|
private
|
39
63
|
|
40
|
-
def endpoint_for(region, service)
|
64
|
+
def endpoint_for(region, service, sts_regional_endpoints)
|
41
65
|
partition = get_partition(region)
|
42
|
-
|
43
|
-
service_cfg = partition.fetch("services", {}).fetch(service, {})
|
66
|
+
service_cfg = partition.fetch('services', {}).fetch(service, {})
|
44
67
|
|
45
|
-
#
|
46
|
-
endpoint = service_cfg
|
68
|
+
# Find the default endpoint
|
69
|
+
endpoint = service_cfg
|
70
|
+
.fetch('defaults', {})
|
71
|
+
.fetch('hostname', partition['defaults']['hostname'])
|
72
|
+
|
73
|
+
# Check for sts legacy behavior
|
74
|
+
sts_legacy = service == 'sts' &&
|
75
|
+
sts_regional_endpoints == 'legacy' &&
|
76
|
+
STS_LEGACY_REGIONS.include?(region)
|
47
77
|
|
48
78
|
# Check for global endpoint.
|
49
|
-
if service_cfg[
|
50
|
-
region = service_cfg.fetch(
|
79
|
+
if sts_legacy || service_cfg['isRegionalized'] == false
|
80
|
+
region = service_cfg.fetch('partitionEndpoint', region)
|
51
81
|
end
|
52
82
|
|
53
83
|
# Check for service/region level endpoint.
|
54
|
-
endpoint = service_cfg
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
hostname_template.
|
63
|
-
sub('{region}', region).
|
64
|
-
sub('{service}', service).
|
65
|
-
sub('{dnsSuffix}', partition["dnsSuffix"])
|
84
|
+
endpoint = service_cfg
|
85
|
+
.fetch('endpoints', {})
|
86
|
+
.fetch(region, {}).fetch('hostname', endpoint)
|
87
|
+
|
88
|
+
# Replace placeholders from the endpoints
|
89
|
+
endpoint.sub('{region}', region)
|
90
|
+
.sub('{service}', service)
|
91
|
+
.sub('{dnsSuffix}', partition['dnsSuffix'])
|
66
92
|
end
|
67
93
|
|
68
94
|
def get_partition(region)
|
69
95
|
partition_containing_region(region) ||
|
70
|
-
|
71
|
-
|
96
|
+
partition_matching_region(region) ||
|
97
|
+
default_partition
|
72
98
|
end
|
73
99
|
|
74
100
|
def partition_containing_region(region)
|
@@ -79,20 +105,21 @@ module Aws
|
|
79
105
|
|
80
106
|
def partition_matching_region(region)
|
81
107
|
@rules['partitions'].find do |p|
|
82
|
-
region.match(p[
|
83
|
-
|
108
|
+
region.match(p['regionRegex']) ||
|
109
|
+
p['services'].values.find do |svc|
|
110
|
+
svc['endpoints'].key?(region) if svc.key?('endpoints')
|
111
|
+
end
|
84
112
|
end
|
85
113
|
end
|
86
114
|
|
87
115
|
def default_partition
|
88
|
-
@rules['partitions'].find { |p| p[
|
89
|
-
|
116
|
+
@rules['partitions'].find { |p| p['partition'] == 'aws' } ||
|
117
|
+
@rules['partitions'].first
|
90
118
|
end
|
91
119
|
|
92
120
|
class << self
|
93
|
-
|
94
|
-
|
95
|
-
default_provider.resolve(region, service)
|
121
|
+
def resolve(region, service, sts_regional_endpoints = 'regional')
|
122
|
+
default_provider.resolve(region, service, sts_regional_endpoints)
|
96
123
|
end
|
97
124
|
|
98
125
|
def signing_region(region, service)
|
@@ -108,7 +135,6 @@ module Aws
|
|
108
135
|
def default_provider
|
109
136
|
@default_provider ||= EndpointProvider.new(Partitions.defaults)
|
110
137
|
end
|
111
|
-
|
112
138
|
end
|
113
139
|
end
|
114
140
|
end
|
@@ -1,7 +1,8 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Aws
|
2
4
|
module Partitions
|
3
5
|
class Partition
|
4
|
-
|
5
6
|
# @option options [required, String] :name
|
6
7
|
# @option options [required, Hash<String,Region>] :regions
|
7
8
|
# @option options [required, Hash<String,Service>] :services
|
@@ -22,8 +23,8 @@ module Aws
|
|
22
23
|
if @regions.key?(region_name)
|
23
24
|
@regions[region_name]
|
24
25
|
else
|
25
|
-
msg = "invalid region name #{region_name.inspect}; valid region "
|
26
|
-
|
26
|
+
msg = "invalid region name #{region_name.inspect}; valid region "\
|
27
|
+
"names include #{@regions.keys.join(', ')}"
|
27
28
|
raise ArgumentError, msg
|
28
29
|
end
|
29
30
|
end
|
@@ -33,6 +34,12 @@ module Aws
|
|
33
34
|
@regions.values
|
34
35
|
end
|
35
36
|
|
37
|
+
# @param [String] region_name The name of the region, e.g. "us-east-1".
|
38
|
+
# @return [Boolean] true if the region is in the partition.
|
39
|
+
def region?(region_name)
|
40
|
+
@regions.key?(region_name)
|
41
|
+
end
|
42
|
+
|
36
43
|
# @param [String] service_name The service module name.
|
37
44
|
# @return [Service]
|
38
45
|
# @raise [ArgumentError] Raises `ArgumentError` for unknown service name.
|
@@ -40,8 +47,8 @@ module Aws
|
|
40
47
|
if @services.key?(service_name)
|
41
48
|
@services[service_name]
|
42
49
|
else
|
43
|
-
msg = "invalid service name #{service_name.inspect}; valid service "
|
44
|
-
|
50
|
+
msg = "invalid service name #{service_name.inspect}; valid service "\
|
51
|
+
"names include #{@services.keys.join(', ')}"
|
45
52
|
raise ArgumentError, msg
|
46
53
|
end
|
47
54
|
end
|
@@ -51,14 +58,19 @@ module Aws
|
|
51
58
|
@services.values
|
52
59
|
end
|
53
60
|
|
54
|
-
|
61
|
+
# @param [String] service_name The service module name.
|
62
|
+
# @return [Boolean] true if the service is in the partition.
|
63
|
+
def service?(service_name)
|
64
|
+
@services.key?(service_name)
|
65
|
+
end
|
55
66
|
|
67
|
+
class << self
|
56
68
|
# @api private
|
57
69
|
def build(partition)
|
58
70
|
Partition.new(
|
59
71
|
name: partition['partition'],
|
60
72
|
regions: build_regions(partition),
|
61
|
-
services: build_services(partition)
|
73
|
+
services: build_services(partition)
|
62
74
|
)
|
63
75
|
end
|
64
76
|
|
@@ -67,28 +79,29 @@ module Aws
|
|
67
79
|
# @param [Hash] partition
|
68
80
|
# @return [Hash<String,Region>]
|
69
81
|
def build_regions(partition)
|
70
|
-
partition['regions'].
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
regions
|
82
|
+
partition['regions'].each_with_object({}) do
|
83
|
+
|(region_name, region), regions|
|
84
|
+
next if region_name == "#{partition['partition']}-global"
|
85
|
+
|
86
|
+
regions[region_name] = Region.build(
|
87
|
+
region_name, region, partition
|
88
|
+
)
|
75
89
|
end
|
76
90
|
end
|
77
91
|
|
78
92
|
# @param [Hash] partition
|
79
93
|
# @return [Hash<String,Service>]
|
80
94
|
def build_services(partition)
|
81
|
-
Partitions.service_ids.
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
95
|
+
Partitions.service_ids.each_with_object({}) do
|
96
|
+
|(service_name, service), services|
|
97
|
+
service_data = partition['services'].fetch(
|
98
|
+
service, 'endpoints' => {}
|
99
|
+
)
|
100
|
+
services[service_name] = Service.build(
|
101
|
+
service_name, service_data, partition
|
102
|
+
)
|
89
103
|
end
|
90
104
|
end
|
91
|
-
|
92
105
|
end
|
93
106
|
end
|
94
107
|
end
|