aws-partitions 1.991.0 → 1.992.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4db62d21f0172df1af9f5707c1d912c091c5ec8e69fa6f1c1547ffb43f57f065
4
- data.tar.gz: 2e5dadb47b2c7b3022823830ac131d9710622039b023ac46aa243f6c22522ff8
3
+ metadata.gz: 3f9a8e68db01ed71555c4736cc1ca7e244eb608f1c127657150e0cd45fc76998
4
+ data.tar.gz: e5e71dab518bd834fe266ca426f08989ae5338054c6b712a312f15c050767ea9
5
5
  SHA512:
6
- metadata.gz: d4e0e51f2d37940d7cbd8b97babc7bef615faf2534abec759bffb32a53231f657649d0bb5b86e920d6ab9ef8abe74f8fdbb3a0bfd394cf7724ed342823fad2b2
7
- data.tar.gz: 814949d443c93ca6fc4088bf18c968ff070edfbe4a2edcd745bf0c819655dc9d37a63e855ab0986ee5b4ad931769b778809df99e27b32856f0283c31eedee95e
6
+ metadata.gz: d21251b52baaf82d422a865542e6f950f9836a8b1b53725c0dd3528d9b5ce3553f28fd7c2d614001944db39545f8c48024b417d206fbd7c40d8bf7470f8ba719
7
+ data.tar.gz: bee52a350c4cbcad8153ea74f78790ce6928ffdacf264c5fdcc64ff67d170b7f274f2f0e460c597f3ea3a8b4edeaac1b438556a742ef916769059dad02ceffc5
data/CHANGELOG.md CHANGED
@@ -1,6 +1,11 @@
1
1
  Unreleased Changes
2
2
  ------------------
3
3
 
4
+ 1.992.0 (2024-10-18)
5
+ ------------------
6
+
7
+ * Feature - Add partition metadata module, allowing access without loading entire partitions.json.
8
+
4
9
  1.991.0 (2024-10-15)
5
10
  ------------------
6
11
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.991.0
1
+ 1.992.0
@@ -0,0 +1,32 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Aws
4
+ module Partitions
5
+ # @api private
6
+ module Metadata
7
+ class << self
8
+
9
+ # aws.partition(region: string) Option<Partition>
10
+ def partition(region)
11
+ partition =
12
+ partitions.find { |p| p['regions']&.fetch(region, nil) } ||
13
+ partitions.find { |p| region.match(p['regionRegex']) } ||
14
+ partitions.find { |p| p['id'] == 'aws' }
15
+
16
+ return nil unless partition
17
+
18
+ partition['outputs']
19
+ end
20
+
21
+ def partitions
22
+ @partitions ||= default_partition_metadata
23
+ end
24
+
25
+ def default_partition_metadata
26
+ path = File.expand_path('../../../partitions-metadata.json', __FILE__)
27
+ JSON.parse(File.read(path), freeze: true)['partitions']
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end
@@ -5,6 +5,7 @@ require_relative 'aws-partitions/partition'
5
5
  require_relative 'aws-partitions/partition_list'
6
6
  require_relative 'aws-partitions/region'
7
7
  require_relative 'aws-partitions/service'
8
+ require_relative 'aws-partitions/metadata'
8
9
 
9
10
  require 'json'
10
11
 
@@ -501,7 +502,6 @@ module Aws
501
502
  'NetworkFirewall' => 'network-firewall',
502
503
  'NetworkManager' => 'networkmanager',
503
504
  'NetworkMonitor' => 'networkmonitor',
504
- 'NimbleStudio' => 'nimble',
505
505
  'OAM' => 'oam',
506
506
  'OSIS' => 'osis',
507
507
  'Omics' => 'omics',
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.991.0
4
+ version: 1.992.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: 2024-10-15 00:00:00.000000000 Z
11
+ date: 2024-10-18 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Provides interfaces to enumerate AWS partitions, regions, and services.
14
14
  email:
@@ -21,6 +21,7 @@ files:
21
21
  - VERSION
22
22
  - lib/aws-partitions.rb
23
23
  - lib/aws-partitions/endpoint_provider.rb
24
+ - lib/aws-partitions/metadata.rb
24
25
  - lib/aws-partitions/partition.rb
25
26
  - lib/aws-partitions/partition_list.rb
26
27
  - lib/aws-partitions/region.rb