awspec 1.5.2 → 1.5.3

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
  SHA1:
3
- metadata.gz: 44af76209138b22176e5d14dae6e0ba6f01348ad
4
- data.tar.gz: d8ec0df5cd855b26bc633db1a5dbcc64fc82d4fa
3
+ metadata.gz: 612b8feb9bcabc485e720db0464a3303241bd28a
4
+ data.tar.gz: '01717679fe98783f79f982c964986164392720b0'
5
5
  SHA512:
6
- metadata.gz: 815b45cac75efea6e1fe28ff2bd498723b83dd0c954cbb73219b1f29409348686131d53e74f4a8a4ab764726d15f71d69d6b79005cb9c0a40e992e928739d6d1
7
- data.tar.gz: a5bd514359d6f55efd6b8bd2201d3fcd7bc3c87b53502c77383dd9ba6638555aa5b48edafd4ecfa07a63deef79ff3fa56e5f358dcfdcce800bd317947061fbc4
6
+ metadata.gz: b7708c1249aad0cfe5f1bd63277feac89fa4fbde08be5a380f6a6067d52a141c0cd173cdb6d50b40f6df61fbccfcdcf9df6454f5b41ea7e4e950d7e85e8a42cc
7
+ data.tar.gz: ee6f48066a3390607337b37f9243ced44c83612f989bc603dadd41fe55afa08a9aa0d25dd8ea4dab20b829d91541563a48bba0f3f6595b2ddc9b65b76e1f0082
@@ -883,7 +883,7 @@ end
883
883
  ```
884
884
 
885
885
 
886
- ### its(:ami_launch_index), its(:image_id), its(:instance_id), its(:instance_type), its(:kernel_id), its(:key_name), its(:launch_time), its(:monitoring), its(:placement), its(:platform), its(:private_dns_name), its(:private_ip_address), its(:product_codes), its(:public_dns_name), its(:public_ip_address), its(:ramdisk_id), its(:state_transition_reason), its(:subnet_id), its(:vpc_id), its(:architecture), its(:client_token), its(:ebs_optimized), its(:ena_support), its(:hypervisor), its(:instance_lifecycle), its(:elastic_gpu_associations), its(:root_device_name), its(:root_device_type), its(:source_dest_check), its(:spot_instance_request_id), its(:sriov_net_support), its(:state_reason), its(:virtualization_type)
886
+ ### its(:ami_launch_index), its(:image_id), its(:instance_id), its(:instance_type), its(:kernel_id), its(:key_name), its(:launch_time), its(:monitoring), its(:placement), its(:platform), its(:private_dns_name), its(:private_ip_address), its(:product_codes), its(:public_dns_name), its(:public_ip_address), its(:ramdisk_id), its(:state_transition_reason), its(:subnet_id), its(:vpc_id), its(:architecture), its(:client_token), its(:ebs_optimized), its(:ena_support), its(:hypervisor), its(:instance_lifecycle), its(:elastic_gpu_associations), its(:root_device_name), its(:root_device_type), its(:source_dest_check), its(:spot_instance_request_id), its(:sriov_net_support), its(:state_reason), its(:virtualization_type), its(:cpu_options)
887
887
  ### :unlock: Advanced use
888
888
 
889
889
  `ec2` can use `Aws::EC2::Instance` resource (see http://docs.aws.amazon.com/sdkforruby/api/Aws/EC2/Instance.html).
@@ -8,14 +8,30 @@ module Awspec::Helper
8
8
  end
9
9
 
10
10
  def find_kms_key_by_alias(key_alias_name)
11
- key = kms_client.list_aliases.aliases.find do |key_alias|
12
- key_alias.alias_name == "alias/#{key_alias_name}"
11
+ alias_name = key_alias_name.start_with?('alias/') ? key_alias_name : "alias/#{key_alias_name}"
12
+ found = nil
13
+ next_marker = nil
14
+
15
+ loop do
16
+ res = kms_client.list_aliases(marker: next_marker, limit: 100)
17
+ found = res.aliases.find { |key_alias| key_alias.alias_name == alias_name }
18
+ (found.nil? && next_marker = res.next_marker) || break
13
19
  end
14
- find_kms_key(key.target_key_id)
20
+
21
+ find_kms_key(found.target_key_id) if found
15
22
  end
16
23
 
17
24
  def select_all_kms_aliases
18
- kms_client.list_aliases.aliases
25
+ all_aliases = []
26
+ next_marker = nil
27
+
28
+ loop do
29
+ res = kms_client.list_aliases(marker: next_marker, limit: 100)
30
+ all_aliases.concat(res.aliases)
31
+ next_marker = res.next_marker || break
32
+ end
33
+
34
+ all_aliases
19
35
  end
20
36
  end
21
37
  end
@@ -1,3 +1,3 @@
1
1
  module Awspec
2
- VERSION = '1.5.2'
2
+ VERSION = '1.5.3'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: awspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.2
4
+ version: 1.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - k1LoW
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-04-22 00:00:00.000000000 Z
11
+ date: 2018-06-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk