awspec 0.57.1 → 0.58.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: 098852643acab9eada61edf343b440e336288276
4
- data.tar.gz: 232d5406799f35017d744730bdaf083f60ec4631
3
+ metadata.gz: c3334e523c4bda9ac92d034cc18bf4a330435444
4
+ data.tar.gz: 6c771f7c68f788d301378ecc2da7b772a7839205
5
5
  SHA512:
6
- metadata.gz: de07c4a5ecb6e49b33ea797edee170b58532cd7ec5b6ba13a5dccecd4dd2cd955aa13231155f06ec360791862c59c449be57fed462fe303c766d13cf7efb607e
7
- data.tar.gz: 5e43aa640ef4653c79132ca431e073ec3cd63c3d28b97355c6aeed69808e935c9df90a1b8777e97346a6bf38470c9cb13690269de73cd17d74fd8632d5882cff
6
+ metadata.gz: ea06a002744a85fd3c71544908a4e91f33e873e5453325da1b8dbf24b1ea29146ed43579941ccedb42ed354d01fdfa0ba0629540896defb94882d9de9c992c29
7
+ data.tar.gz: 760ca5e05665f1df031840aad1f39be2be5ab35ee8178dedf6da0f66ff59a3f24006bfaf0c5989b0e8be24075785f109153c3186ce040027408e54bf14efb64e
data/.rubocop.yml CHANGED
@@ -25,6 +25,10 @@ Metrics/LineLength:
25
25
  Metrics/MethodLength:
26
26
  Max: 30
27
27
 
28
+ Metrics/ModuleLength:
29
+ CountComments: false
30
+ Max: 200
31
+
28
32
  Metrics/PerceivedComplexity:
29
33
  Max: 15
30
34
 
@@ -0,0 +1,25 @@
1
+ ### exist
2
+
3
+ ```ruby
4
+ describe customer_gateway('my-customer-gateway') do
5
+ it { should exist }
6
+ end
7
+ ```
8
+
9
+ ### be_pending, be_available, be_deleting, be_deleted
10
+
11
+ ```ruby
12
+ describe customer_gateway('my-customer-gateway') do
13
+ it { should be_running }
14
+ end
15
+ ```
16
+
17
+ ### have_tag
18
+
19
+ ```ruby
20
+ describe customer_gateway('my-customer-gateway') do
21
+ it { should have_tag('Name').value('my-customer-gateway') }
22
+ end
23
+ ```
24
+
25
+ ### its(:customer_gateway_id), its(:state), its(:type), its(:ip_address), its(:bgp_asn)
@@ -0,0 +1,25 @@
1
+ ### exist
2
+
3
+ ```ruby
4
+ describe vpn_connection('my-vpn-connection') do
5
+ it { should exist }
6
+ end
7
+ ```
8
+
9
+ ### be_pending, be_available, be_deleting, be_deleted
10
+
11
+ ```ruby
12
+ describe vpn_connection('my-vpn-connection') do
13
+ it { should be_running }
14
+ end
15
+ ```
16
+
17
+ ### have_tag
18
+
19
+ ```ruby
20
+ describe vpn_connection('my-vpn-connection') do
21
+ it { should have_tag('Name').value('my-vpn-connection') }
22
+ end
23
+ ```
24
+
25
+ ### its(:vpn_connection_id), its(:state), its(:customer_gateway_configuration), its(:type), its(:customer_gateway_id), its(:vpn_gateway_id), its(:options)
@@ -0,0 +1,25 @@
1
+ ### exist
2
+
3
+ ```ruby
4
+ describe vpn_gateway('my-vpn-gateway') do
5
+ it { should exist }
6
+ end
7
+ ```
8
+
9
+ ### be_pending, be_available, be_deleting, be_deleted
10
+
11
+ ```ruby
12
+ describe vpn_gateway('my-vpn-gateway') do
13
+ it { should be_running }
14
+ end
15
+ ```
16
+
17
+ ### have_tag
18
+
19
+ ```ruby
20
+ describe vpn_gateway('my-vpn-gateway') do
21
+ it { should have_tag('Name').value('my-vpn-gateway') }
22
+ end
23
+ ```
24
+
25
+ ### its(:vpn_gateway_id), its(:state), its(:type), its(:availability_zone)
@@ -35,6 +35,9 @@
35
35
  | [cloudfront_distribution](#cloudfront_distribution)
36
36
  | [elastictranscoder_pipeline](#elastictranscoder_pipeline)
37
37
  | [waf_web_acl](#waf_web_acl)
38
+ | [customer_gateway](#customer_gateway)
39
+ | [vpn_gateway](#vpn_gateway)
40
+ | [vpn_connection](#vpn_connection)
38
41
 
39
42
  ## <a name="ami">ami</a>
40
43
 
@@ -1881,3 +1884,99 @@ end
1881
1884
 
1882
1885
 
1883
1886
  ### its(:default_action), its(:web_acl_id), its(:name), its(:metric_name)
1887
+ ## <a name="customer_gateway">customer_gateway</a>
1888
+
1889
+ CustomerGateway resource type.
1890
+
1891
+ ### exist
1892
+
1893
+ ```ruby
1894
+ describe customer_gateway('my-customer-gateway') do
1895
+ it { should exist }
1896
+ end
1897
+ ```
1898
+
1899
+
1900
+ ### be_pending, be_available, be_deleting, be_deleted
1901
+
1902
+ ```ruby
1903
+ describe customer_gateway('my-customer-gateway') do
1904
+ it { should be_running }
1905
+ end
1906
+ ```
1907
+
1908
+
1909
+ ### have_tag
1910
+
1911
+ ```ruby
1912
+ describe customer_gateway('my-customer-gateway') do
1913
+ it { should have_tag('Name').value('my-customer-gateway') }
1914
+ end
1915
+ ```
1916
+
1917
+
1918
+ ### its(:customer_gateway_id), its(:state), its(:type), its(:ip_address), its(:bgp_asn)
1919
+ ## <a name="vpn_gateway">vpn_gateway</a>
1920
+
1921
+ VpnGateway resource type.
1922
+
1923
+ ### exist
1924
+
1925
+ ```ruby
1926
+ describe vpn_gateway('my-vpn-gateway') do
1927
+ it { should exist }
1928
+ end
1929
+ ```
1930
+
1931
+
1932
+ ### be_pending, be_available, be_deleting, be_deleted
1933
+
1934
+ ```ruby
1935
+ describe vpn_gateway('my-vpn-gateway') do
1936
+ it { should be_running }
1937
+ end
1938
+ ```
1939
+
1940
+
1941
+ ### have_tag
1942
+
1943
+ ```ruby
1944
+ describe vpn_gateway('my-vpn-gateway') do
1945
+ it { should have_tag('Name').value('my-vpn-gateway') }
1946
+ end
1947
+ ```
1948
+
1949
+
1950
+ ### its(:vpn_gateway_id), its(:state), its(:type), its(:availability_zone)
1951
+ ## <a name="vpn_connection">vpn_connection</a>
1952
+
1953
+ VpnConnection resource type.
1954
+
1955
+ ### exist
1956
+
1957
+ ```ruby
1958
+ describe vpn_connection('my-vpn-connection') do
1959
+ it { should exist }
1960
+ end
1961
+ ```
1962
+
1963
+
1964
+ ### be_pending, be_available, be_deleting, be_deleted
1965
+
1966
+ ```ruby
1967
+ describe vpn_connection('my-vpn-connection') do
1968
+ it { should be_running }
1969
+ end
1970
+ ```
1971
+
1972
+
1973
+ ### have_tag
1974
+
1975
+ ```ruby
1976
+ describe vpn_connection('my-vpn-connection') do
1977
+ it { should have_tag('Name').value('my-vpn-connection') }
1978
+ end
1979
+ ```
1980
+
1981
+
1982
+ ### its(:vpn_connection_id), its(:state), its(:customer_gateway_configuration), its(:type), its(:customer_gateway_id), its(:vpn_gateway_id), its(:options)
@@ -0,0 +1,19 @@
1
+ module Awspec::Generator
2
+ module Doc
3
+ module Type
4
+ class CustomerGateway < Base
5
+ def initialize
6
+ super
7
+ @type_name = 'CustomerGateway'
8
+ @type = Awspec::Type::CustomerGateway.new('my-customer-gateway')
9
+ @ret = @type.resource_via_client
10
+ @matchers = [
11
+ Awspec::Type::CustomerGateway::STATES.map { |state| 'be_' + state.tr('-', '_') }.join(', ')
12
+ ]
13
+ @ignore_matchers = Awspec::Type::CustomerGateway::STATES.map { |state| 'be_' + state.tr('-', '_') }
14
+ @describes = []
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,19 @@
1
+ module Awspec::Generator
2
+ module Doc
3
+ module Type
4
+ class VpnConnection < Base
5
+ def initialize
6
+ super
7
+ @type_name = 'VpnConnection'
8
+ @type = Awspec::Type::VpnConnection.new('my-vpn-connection')
9
+ @ret = @type.resource_via_client
10
+ @matchers = [
11
+ Awspec::Type::VpnConnection::STATES.map { |state| 'be_' + state.tr('-', '_') }.join(', ')
12
+ ]
13
+ @ignore_matchers = Awspec::Type::VpnConnection::STATES.map { |state| 'be_' + state.tr('-', '_') }
14
+ @describes = []
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,19 @@
1
+ module Awspec::Generator
2
+ module Doc
3
+ module Type
4
+ class VpnGateway < Base
5
+ def initialize
6
+ super
7
+ @type_name = 'VpnGateway'
8
+ @type = Awspec::Type::VpnGateway.new('my-vpn-gateway')
9
+ @ret = @type.resource_via_client
10
+ @matchers = [
11
+ Awspec::Type::VpnGateway::STATES.map { |state| 'be_' + state.tr('-', '_') }.join(', ')
12
+ ]
13
+ @ignore_matchers = Awspec::Type::VpnGateway::STATES.map { |state| 'be_' + state.tr('-', '_') }
14
+ @describes = []
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -49,6 +49,18 @@ module Awspec::Helper
49
49
  end
50
50
  end
51
51
 
52
+ def find_vpn_connection(vpn_connection_id)
53
+ res = ec2_client.describe_vpn_connections({
54
+ filters: [
55
+ {
56
+ name: 'vpn-connection-id',
57
+ values: [vpn_connection_id]
58
+ }
59
+ ]
60
+ })
61
+ res.vpn_connections.single_resource(vpn_connection_id)
62
+ end
63
+
52
64
  def find_nat_gateway(gateway_id)
53
65
  res = ec2_client.describe_nat_gateways({
54
66
  filter: [{ name: 'nat-gateway-id', values: [gateway_id] }]
@@ -9,7 +9,7 @@ module Awspec
9
9
  iam_policy iam_role iam_user kms lambda launch_configuration nat_gateway
10
10
  network_acl network_interface rds rds_db_cluster_parameter_group rds_db_parameter_group route53_hosted_zone
11
11
  route_table s3_bucket security_group ses_identity subnet vpc cloudfront_distribution
12
- elastictranscoder_pipeline waf_web_acl
12
+ elastictranscoder_pipeline waf_web_acl customer_gateway vpn_gateway vpn_connection
13
13
  )
14
14
 
15
15
  TYPES.each do |type|
@@ -0,0 +1,16 @@
1
+ # rubocop:disable all
2
+ Aws.config[:ec2] = {
3
+ stub_responses: {
4
+ describe_customer_gateways: {
5
+ customer_gateways: [
6
+ {
7
+ customer_gateway_id: 'cgw-cg5692g4',
8
+ ip_address: '1.1.1.1',
9
+ state: 'available',
10
+ type: "ipsec.1",
11
+ bgp_asn: "65000"
12
+ }
13
+ ]
14
+ }
15
+ }
16
+ }
@@ -0,0 +1,16 @@
1
+ # rubocop:disable all
2
+ Aws.config[:ec2] = {
3
+ stub_responses: {
4
+ describe_vpn_connections: {
5
+ vpn_connections: [
6
+ {
7
+ vpn_connection_id: 'vpn-cg5692g4',
8
+ customer_gateway_id: 'cgw-cg5692g4',
9
+ vpn_gateway_id: 'vgw-cg5692g4',
10
+ state: 'available',
11
+ type: "ipsec.1"
12
+ }
13
+ ]
14
+ }
15
+ }
16
+ }
@@ -0,0 +1,15 @@
1
+ # rubocop:disable all
2
+ Aws.config[:ec2] = {
3
+ stub_responses: {
4
+ describe_vpn_gateways: {
5
+ vpn_gateways: [
6
+ {
7
+ vpn_gateway_id: 'vgw-cg5692g4',
8
+ availability_zone: 'us-east-1a',
9
+ state: 'available',
10
+ type: "ipsec.1"
11
+ }
12
+ ]
13
+ }
14
+ }
15
+ }
@@ -0,0 +1,40 @@
1
+ module Awspec::Type
2
+ class CustomerGateway < Base
3
+ tags_allowed
4
+
5
+ def initialize(name)
6
+ super
7
+ @display_name = name
8
+ end
9
+
10
+ def resource_via_client
11
+ @resource_via_client ||= find_customer_gateway(@display_name)
12
+ end
13
+
14
+ def id
15
+ @id ||= resource_via_client.customer_gateway_id if resource_via_client
16
+ end
17
+
18
+ STATES = %w(
19
+ pending available deleting deleted
20
+ )
21
+
22
+ STATES.each do |state|
23
+ define_method state.tr('-', '_') + '?' do
24
+ resource_via_client.state == state
25
+ end
26
+ end
27
+
28
+ def ip_address
29
+ resource_via_client.ip_address
30
+ end
31
+
32
+ def bpg_asn
33
+ resource_via_client.bpg_asn
34
+ end
35
+
36
+ def type
37
+ resource_via_client.type
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,40 @@
1
+ module Awspec::Type
2
+ class VpnConnection < Base
3
+ tags_allowed
4
+
5
+ def initialize(name)
6
+ super
7
+ @display_name = name
8
+ end
9
+
10
+ def resource_via_client
11
+ @resource_via_client ||= find_vpn_connection(@display_name)
12
+ end
13
+
14
+ def id
15
+ @id ||= resource_via_client.vpn_connection_id if resource_via_client
16
+ end
17
+
18
+ STATES = %w(
19
+ pending available deleting deleted
20
+ )
21
+
22
+ STATES.each do |state|
23
+ define_method state.tr('-', '_') + '?' do
24
+ resource_via_client.state == state
25
+ end
26
+ end
27
+
28
+ def customer_gateway_id
29
+ resource_via_client.customer_gateway_id
30
+ end
31
+
32
+ def vpn_gateway_id
33
+ resource_via_client.vpn_gateway_id
34
+ end
35
+
36
+ def type
37
+ resource_via_client.type
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,40 @@
1
+ module Awspec::Type
2
+ class VpnGateway < Base
3
+ tags_allowed
4
+
5
+ def initialize(name)
6
+ super
7
+ @display_name = name
8
+ end
9
+
10
+ def resource_via_client
11
+ @resource_via_client ||= find_vpn_gateway(@display_name)
12
+ end
13
+
14
+ def id
15
+ @id ||= resource_via_client.vpn_gateway_id if resource_via_client
16
+ end
17
+
18
+ STATES = %w(
19
+ pending available deleting deleted
20
+ )
21
+
22
+ STATES.each do |state|
23
+ define_method state.tr('-', '_') + '?' do
24
+ resource_via_client.state == state
25
+ end
26
+ end
27
+
28
+ def availability_zone
29
+ resource_via_client.availability_zone
30
+ end
31
+
32
+ def vpc_attachments
33
+ resource_via_client.vpc_attachments
34
+ end
35
+
36
+ def type
37
+ resource_via_client.type
38
+ end
39
+ end
40
+ end
@@ -1,3 +1,3 @@
1
1
  module Awspec
2
- VERSION = '0.57.1'
2
+ VERSION = '0.58.0'
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.57.1
4
+ version: 0.58.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - k1LoW
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-10-21 00:00:00.000000000 Z
11
+ date: 2016-11-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -211,6 +211,7 @@ files:
211
211
  - doc/_resource_types/cloudfront_distribution.md
212
212
  - doc/_resource_types/cloudtrail.md
213
213
  - doc/_resource_types/cloudwatch_alarm.md
214
+ - doc/_resource_types/customer_gateway.md
214
215
  - doc/_resource_types/directconnect_virtual_interface.md
215
216
  - doc/_resource_types/ebs.md
216
217
  - doc/_resource_types/ec2.md
@@ -239,6 +240,8 @@ files:
239
240
  - doc/_resource_types/ses_identity.md
240
241
  - doc/_resource_types/subnet.md
241
242
  - doc/_resource_types/vpc.md
243
+ - doc/_resource_types/vpn_connection.md
244
+ - doc/_resource_types/vpn_gateway.md
242
245
  - doc/_resource_types/waf_web_acl.md
243
246
  - doc/contributing.md
244
247
  - doc/resource_types.md
@@ -259,6 +262,7 @@ files:
259
262
  - lib/awspec/generator/doc/type/cloudtrail.rb
260
263
  - lib/awspec/generator/doc/type/cloudwatch_alarm.rb
261
264
  - lib/awspec/generator/doc/type/cloudwatch_event.rb
265
+ - lib/awspec/generator/doc/type/customer_gateway.rb
262
266
  - lib/awspec/generator/doc/type/directconnect_virtual_interface.rb
263
267
  - lib/awspec/generator/doc/type/ebs.rb
264
268
  - lib/awspec/generator/doc/type/ec2.rb
@@ -287,6 +291,8 @@ files:
287
291
  - lib/awspec/generator/doc/type/ses_identity.rb
288
292
  - lib/awspec/generator/doc/type/subnet.rb
289
293
  - lib/awspec/generator/doc/type/vpc.rb
294
+ - lib/awspec/generator/doc/type/vpn_connection.rb
295
+ - lib/awspec/generator/doc/type/vpn_gateway.rb
290
296
  - lib/awspec/generator/doc/type/waf_web_acl.rb
291
297
  - lib/awspec/generator/spec/cloudwatch_alarm.rb
292
298
  - lib/awspec/generator/spec/cloudwatch_event.rb
@@ -372,6 +378,7 @@ files:
372
378
  - lib/awspec/stub/cloudtrail.rb
373
379
  - lib/awspec/stub/cloudwatch_alarm.rb
374
380
  - lib/awspec/stub/cloudwatch_event.rb
381
+ - lib/awspec/stub/customer_gateway.rb
375
382
  - lib/awspec/stub/directconnect_virtual_interface.rb
376
383
  - lib/awspec/stub/duplicated_resource_type.rb
377
384
  - lib/awspec/stub/ebs.rb
@@ -401,6 +408,8 @@ files:
401
408
  - lib/awspec/stub/ses_identity.rb
402
409
  - lib/awspec/stub/subnet.rb
403
410
  - lib/awspec/stub/vpc.rb
411
+ - lib/awspec/stub/vpn_connection.rb
412
+ - lib/awspec/stub/vpn_gateway.rb
404
413
  - lib/awspec/stub/waf_web_acl.rb
405
414
  - lib/awspec/toolbox.rb
406
415
  - lib/awspec/type/ami.rb
@@ -410,6 +419,7 @@ files:
410
419
  - lib/awspec/type/cloudtrail.rb
411
420
  - lib/awspec/type/cloudwatch_alarm.rb
412
421
  - lib/awspec/type/cloudwatch_event.rb
422
+ - lib/awspec/type/customer_gateway.rb
413
423
  - lib/awspec/type/directconnect_virtual_interface.rb
414
424
  - lib/awspec/type/ebs.rb
415
425
  - lib/awspec/type/ec2.rb
@@ -438,6 +448,8 @@ files:
438
448
  - lib/awspec/type/ses_identity.rb
439
449
  - lib/awspec/type/subnet.rb
440
450
  - lib/awspec/type/vpc.rb
451
+ - lib/awspec/type/vpn_connection.rb
452
+ - lib/awspec/type/vpn_gateway.rb
441
453
  - lib/awspec/type/waf_web_acl.rb
442
454
  - lib/awspec/version.rb
443
455
  homepage: https://github.com/k1LoW/awspec