awspec 0.39.0 → 0.40.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
  SHA1:
3
- metadata.gz: df90524881e64ff3e5ac8bc37f8e5ec072ddc96c
4
- data.tar.gz: fabf6bde9a379ebdadffc0f77954ec148e05a73f
3
+ metadata.gz: 87b146bacf7bc86a5d3290c9a7d01cef0a73d108
4
+ data.tar.gz: 0de59c9a0d46e0fe919eda736d9c539f5af26cc5
5
5
  SHA512:
6
- metadata.gz: 4b09130c34321068faf6ce68723c542f61c46b3048d8c51976ee523629b538f94a3c7926570b890e42b677983815ca617a2cd6952c47d3b1d141fbc72038219a
7
- data.tar.gz: 0c2ad5e40a8c7f674d83a0a213fceadff9eff2e419a3743b80c4d4204c461afab4d550acc152c1174befd198c4d1c9130b16016c20b3185b77a5103321053570
6
+ metadata.gz: e5a70c321ccae810054547e002b28359c58706be4993ea1894e14eecc1f23e6cd03b56c88bb8a80c69d3008fc8a694b674d1fd2434dca5fbe8634e0c38c99f05
7
+ data.tar.gz: e9d793140ca21b4b894709d756cfe91fd72172b3300ed9f76fca4f9c73ee4d7220e5f7333d61fca82de555da97eb6af2729baec0a7d68d044bce4eb578992212
@@ -30,6 +30,15 @@ describe ec2('my-ec2-classic') do
30
30
  end
31
31
  ```
32
32
 
33
+ ### have_classiclink_security_group
34
+
35
+ ```ruby
36
+ describe ec2('my-ec2-classic') do
37
+ it { should have_classiclink_security_group('sg-2a3b4cd5') }
38
+ it { should have_classiclink_security_group('my-vpc-security-group-name') }
39
+ end
40
+ ```
41
+
33
42
  ### have_ebs
34
43
 
35
44
  ```ruby
@@ -262,6 +262,16 @@ end
262
262
  ```
263
263
 
264
264
 
265
+ ### have_classiclink_security_group
266
+
267
+ ```ruby
268
+ describe ec2('my-ec2-classic') do
269
+ it { should have_classiclink_security_group('sg-2a3b4cd5') }
270
+ it { should have_classiclink_security_group('my-vpc-security-group-name') }
271
+ end
272
+ ```
273
+
274
+
265
275
  ### have_ebs
266
276
 
267
277
  ```ruby
@@ -145,7 +145,11 @@ Aws.config[:ec2] = {
145
145
  describe_classic_link_instances: {
146
146
  instances: [
147
147
  instance_id: 'my-ec2-classic',
148
- vpc_id: 'my-vpc'
148
+ vpc_id: 'my-vpc',
149
+ groups: [
150
+ { group_name: nil, group_id: 'sg-2a3b4cd5' },
151
+ { group_name: 'my-vpc-security-group-name', group_id: nil }
152
+ ]
149
153
  ]
150
154
  }
151
155
  }
@@ -82,5 +82,19 @@ module Awspec::Type
82
82
  ret = ec2_client.describe_classic_link_instances(option)
83
83
  return ret.instances.count == 1 if vpc_id
84
84
  end
85
+
86
+ def has_classiclink_security_group?(sg_id)
87
+ option = {
88
+ instance_ids: [@id]
89
+ }
90
+ classic_link_instances = ec2_client.describe_classic_link_instances(option)
91
+ return false if classic_link_instances.instances.count == 0
92
+ instances = classic_link_instances[0]
93
+ sgs = instances[0].groups
94
+ ret = sgs.find do |sg|
95
+ sg.group_id == sg_id || sg.group_name == sg_id
96
+ end
97
+ return true if ret
98
+ end
85
99
  end
86
100
  end
@@ -1,3 +1,3 @@
1
1
  module Awspec
2
- VERSION = '0.39.0'
2
+ VERSION = '0.40.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: awspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.39.0
4
+ version: 0.40.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - k1LoW