awspec 0.80.0 → 0.80.1

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: 57966c7cb37d9173d0212f0d2a48d1b63dad257a
4
- data.tar.gz: 5504e5dfcde33cbe0f13a72302e42328a048ea19
3
+ metadata.gz: 79351e0f4e5a1c92f7a8eff5f257148330acbbd6
4
+ data.tar.gz: 12789b620b3b6b9c90ffbcefa324fef5e8271883
5
5
  SHA512:
6
- metadata.gz: 713a88da3b16b47c8c1a2c8ff0f3b56bb6bc28f679ee783094196f71b7f86af95d171eca8749874c2c5c7e5674d235d9c45b1a4e693479b2ba0a7df9fa9003a6
7
- data.tar.gz: 4cd882a3b50dab6cc0af276665dbe3e31ee79937be54ba37e53dfa6102e95fcc01ae12bf94886364607916a073ebf4c6f85f87dd21160c47027abd3f050d0765
6
+ metadata.gz: 95d4a780f9ac2c05a0edb44a13e1e6de4d5cb7e308d56cdfbba50b11d4610709e48330450b30f9b9e60e60b1c6d260249e97b8410b64c48e4184ab540b192b67
7
+ data.tar.gz: 2191c44374acb5cd7a48d660f5c200402653e77cf38f89fd348fea60376ab8f6ede60e9e6f15846bd5a97d03058ce25e13e4a8d60422afb934c00afd37992785
@@ -1,23 +1,21 @@
1
1
  module Awspec::Helper
2
2
  module Finder
3
3
  module Subnet
4
- def filter_type_matcher(search_key)
5
- deafult = 'tag:Name'
6
- case search_key
7
- when /subnet-[a-zA-Z0-9]{8}/
8
- return 'subnet-id'
9
- when %r{[1-9][0-9]{1,2}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}//[0-9]{1,3}}
10
- return 'cidrBlock'
11
- else
12
- return deafult
13
- end
14
- end
15
-
16
- def find_subnet(search_key)
4
+ def find_subnet(subnet_id)
5
+ res = ec2_client.describe_subnets({
6
+ filters: [{ name: 'subnet-id', values: [subnet_id] }]
7
+ })
8
+ resource = res.subnets.single_resource(subnet_id)
9
+ return resource if resource
10
+ res = ec2_client.describe_subnets({
11
+ filters: [{ name: 'tag:Name', values: [subnet_id] }]
12
+ })
13
+ resource = res.subnets.single_resource(subnet_id)
14
+ return resource if resource
17
15
  res = ec2_client.describe_subnets({
18
- filters: [{ name: filter_type_matcher(search_key), values: [search_key] }]
16
+ filters: [{ name: 'cidrBlock', values: [subnet_id] }]
19
17
  })
20
- res.subnets.single_resource(search_key)
18
+ res.subnets.single_resource(subnet_id)
21
19
  end
22
20
 
23
21
  def select_subnet_by_vpc_id(vpc_id)
@@ -1,3 +1,3 @@
1
1
  module Awspec
2
- VERSION = '0.80.0'
2
+ VERSION = '0.80.1'
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: 0.80.0
4
+ version: 0.80.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - k1LoW
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-05-17 00:00:00.000000000 Z
11
+ date: 2017-05-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec