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 +4 -4
- data/doc/resource_types.md +1 -1
- data/lib/awspec/helper/finder/kms.rb +20 -4
- data/lib/awspec/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 612b8feb9bcabc485e720db0464a3303241bd28a
|
4
|
+
data.tar.gz: '01717679fe98783f79f982c964986164392720b0'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b7708c1249aad0cfe5f1bd63277feac89fa4fbde08be5a380f6a6067d52a141c0cd173cdb6d50b40f6df61fbccfcdcf9df6454f5b41ea7e4e950d7e85e8a42cc
|
7
|
+
data.tar.gz: ee6f48066a3390607337b37f9243ced44c83612f989bc603dadd41fe55afa08a9aa0d25dd8ea4dab20b829d91541563a48bba0f3f6595b2ddc9b65b76e1f0082
|
data/doc/resource_types.md
CHANGED
@@ -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
|
-
|
12
|
-
|
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
|
-
|
20
|
+
|
21
|
+
find_kms_key(found.target_key_id) if found
|
15
22
|
end
|
16
23
|
|
17
24
|
def select_all_kms_aliases
|
18
|
-
|
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
|
data/lib/awspec/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2018-06-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk
|