awspec 0.21.6 → 0.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a1460649584f4b8d133bbe1180f35d633563d03a
4
- data.tar.gz: dcaa2a75bd3d5d357394673bef593edf32fc7e35
3
+ metadata.gz: 68149318fb33129a9b8814554795a1fd6a9b4c57
4
+ data.tar.gz: 9350864bcb6392638d6b2a17578ed9cf403ac349
5
5
  SHA512:
6
- metadata.gz: 7e000cb38f017614ebd3c6755ee685ea9ac21f51366576f460969f73611e8090f4e7ec6a66a7e37497c56deec71f563ec5dc425f5bc9c33ece941de65303b45b
7
- data.tar.gz: bd045a0959d20e61603592236a5ed664f9d7dd7a51b3f418c0ddcc28a19dbd4ef74998167c2183c4b46b146b41dbbdca2ddd58aa04de908d40349099420ddd91
6
+ metadata.gz: a8aaf23a1653c953c7f4940f796ccf229c6c33ab0931113e2348f6c03524de4fe544fc1e1949baccf1cd05ce5be258c215806b1f01f1e19d931800ba01a0906c
7
+ data.tar.gz: d9c4130c0e20d68985b22deafa320b0390c3fc4d2cec0bb3ee838ff5440c66aeb0ffd0334ef8d2db0418712427e413430c1a9189808d7eb135b846aff9d8d413
data/README.md CHANGED
@@ -86,35 +86,7 @@ $ export AWS_PROFILE=mycreds; bundle exec rake spec
86
86
 
87
87
  ## Support AWS Resources
88
88
 
89
- - [x] EC2 (`ec2`)
90
- - [x] RDS (`rds`)
91
- - [x] RDS DB Parameter Group (`rds_db_parameter_group`)
92
- - [x] Security Group (`security_group`)
93
- - [x] VPC (`vpc`)
94
- - [x] S3 (`s3`)
95
- - Route53
96
- - [x] Route53 Hosted Zone (`route53_hosted_zone`)
97
- - AutoScaling
98
- - [x] AutoScaling Group (`autoscaling_group`)
99
- - [x] Subnet (`subnet`)
100
- - [x] RouteTable (`route_table`)
101
- - [x] EBS Volume (`ebs`)
102
- - [x] ELB (`elb`)
103
- - [x] Lambda (`lambda`)
104
- - IAM
105
- - [x] IAM User (`iam_user`)
106
- - [x] IAM Group (`iam_group`)
107
- - [x] IAM Role (`iam_role`)
108
- - [x] IAM Policy (`iam_policy`)
109
- - [x] ElastiCache (`elasticache`)
110
- - [x] ElastiCache Cache Parameter Group (`elasticache_cache_parameter_group`)
111
- - CloudWatch
112
- - [x] CloudWatch Alarm (`cloudwatch_alarm`)
113
- - SES
114
- - [x] SES Identity (`ses_identity`)
115
- - [x] NetworkAcl (`network_acl`)
116
-
117
- [Resource Types more infomation here](doc/resource_types.md)
89
+ [Resource Types infomation here](doc/resource_types.md)
118
90
 
119
91
  ## References
120
92
 
@@ -22,6 +22,7 @@
22
22
  | [cloudwatch_alarm](#cloudwatch_alarm)
23
23
  | [ses_identity](#ses_identity)
24
24
  | [network_acl](#network_acl)
25
+ | [directconnect_virtual_interface](#directconnect_virtual_interface)
25
26
 
26
27
  ## <a name="ec2">ec2</a>
27
28
 
@@ -461,3 +462,24 @@ end
461
462
  ```
462
463
 
463
464
  #### its(:inbound_entries_count), its(:outbound_entries_count), its(:network_acl_id), its(:vpc_id), its(:is_default)
465
+ ## <a name="directconnect_virtual_interface">directconnect_virtual_interface</a>
466
+
467
+ DirectconnectVirtualInterface resource type.
468
+
469
+ ### exist
470
+
471
+ ### be_available
472
+
473
+ ### be_confirming
474
+
475
+ ### be_deleted
476
+
477
+ ### be_deleting
478
+
479
+ ### be_pending
480
+
481
+ ### be_rejected
482
+
483
+ ### be_verifying
484
+
485
+ #### its(:owner_account), its(:virtual_interface_id), its(:location), its(:connection_id), its(:virtual_interface_type), its(:virtual_interface_name), its(:vlan), its(:asn), its(:auth_key), its(:amazon_address), its(:customer_address), its(:virtual_interface_state), its(:customer_router_config), its(:virtual_gateway_id)
@@ -26,7 +26,7 @@ module Awspec
26
26
  end
27
27
 
28
28
  types_for_generate_all = %w(
29
- iam_policy cloudwatch_alarm
29
+ iam_policy cloudwatch_alarm directconnect
30
30
  )
31
31
 
32
32
  types_for_generate_all.each do |type|
@@ -12,6 +12,7 @@ require 'awspec/generator/spec/cloudwatch_alarm'
12
12
  require 'awspec/generator/spec/network_acl'
13
13
  require 'awspec/generator/spec/route_table'
14
14
  require 'awspec/generator/spec/subnet'
15
+ require 'awspec/generator/spec/directconnect'
15
16
 
16
17
  # Doc
17
18
  require 'awspec/generator/doc/type'
@@ -0,0 +1,17 @@
1
+ module Awspec::Generator
2
+ module Doc
3
+ module Type
4
+ class DirectconnectVirtualInterface < Base
5
+ def initialize
6
+ super
7
+ @type_name = 'DirectconnectVirtualInterface'
8
+ @type = Awspec::Type::DirectconnectVirtualInterface.new('my-directconnect-virtual-interface')
9
+ @ret = @type.resource
10
+ @matchers = []
11
+ @ignore_matchers = []
12
+ @describes = []
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,33 @@
1
+ module Awspec::Generator
2
+ module Spec
3
+ class Directconnect
4
+ include Awspec::Helper::Finder
5
+ def generate_all
6
+ generate_virtual_interface_all
7
+ end
8
+
9
+ def generate_virtual_interface_all
10
+ virtual_interfaces = select_virtual_interfaces
11
+ virtual_interfaces.empty? && fail('Not Found virtual_interfaces')
12
+ ERB.new(virtual_interface_spec_template, nil, '-').result(binding).chomp
13
+ end
14
+
15
+ def virtual_interface_spec_template
16
+ template = <<-'EOF'
17
+ <% virtual_interfaces.each do |interface| %>
18
+ describe directconnect_virtual_interface('<%= interface.virtual_interface_name %>') do
19
+ it { should exist }
20
+ it { should be_<%= interface.virtual_interface_state %> }
21
+ its(:connection_id) { should eq '<%= interface.connection_id %>' }
22
+ its(:virtual_interface_id) { should eq '<%= interface.virtual_interface_id %>' }
23
+ its(:amazon_address) { should eq '<%= interface.amazon_address %>' }
24
+ its(:customer_address) { should eq '<%= interface.customer_address %>' }
25
+ its(:virtual_gateway_id) { should eq '<%= interface.virtual_gateway_id %>' }
26
+ end
27
+ <% end %>
28
+ EOF
29
+ template
30
+ end
31
+ end
32
+ end
33
+ end
@@ -13,6 +13,7 @@ require 'awspec/helper/finder/iam'
13
13
  require 'awspec/helper/finder/elasticache'
14
14
  require 'awspec/helper/finder/cloudwatch'
15
15
  require 'awspec/helper/finder/ses'
16
+ require 'awspec/helper/finder/directconnect'
16
17
 
17
18
  module Awspec::Helper
18
19
  module Finder
@@ -31,6 +32,7 @@ module Awspec::Helper
31
32
  include Awspec::Helper::Finder::Elasticache
32
33
  include Awspec::Helper::Finder::Cloudwatch
33
34
  include Awspec::Helper::Finder::Ses
35
+ include Awspec::Helper::Finder::Directconnect
34
36
 
35
37
  # rubocop:disable all
36
38
  def initialize(id = nil)
@@ -45,6 +47,7 @@ module Awspec::Helper
45
47
  @elasticache_client = Aws::ElastiCache::Client.new
46
48
  @cloudwatch_client = Aws::CloudWatch::Client.new
47
49
  @ses_client = Aws::SES::Client.new
50
+ @directconnect_client = Aws::DirectConnect::Client.new
48
51
  end
49
52
  end
50
53
  end
@@ -0,0 +1,19 @@
1
+ module Awspec::Helper
2
+ module Finder
3
+ module Directconnect
4
+ def find_virtual_interface(virtual_interface_id)
5
+ res = @directconnect_client.describe_virtual_interfaces
6
+ ret = res.virtual_interfaces.select do |virtual_interface|
7
+ next true if virtual_interface.virtual_interface_id == virtual_interface_id
8
+ next true if virtual_interface.virtual_interface_name == virtual_interface_id
9
+ end
10
+ return ret.first if ret.count == 1
11
+ end
12
+
13
+ def select_virtual_interfaces
14
+ res = @directconnect_client.describe_virtual_interfaces
15
+ res.virtual_interfaces
16
+ end
17
+ end
18
+ end
19
+ end
@@ -6,7 +6,7 @@ module Awspec
6
6
  vpc s3 route53_hosted_zone autoscaling_group subnet
7
7
  route_table ebs elb lambda iam_user iam_group iam_role
8
8
  iam_policy elasticache elasticache_cache_parameter_group
9
- cloudwatch_alarm ses_identity network_acl
9
+ cloudwatch_alarm ses_identity network_acl directconnect_virtual_interface
10
10
  )
11
11
 
12
12
  TYPES.each do |type|
@@ -0,0 +1,25 @@
1
+ Aws.config[:directconnect] = {
2
+ stub_responses: {
3
+ describe_virtual_interfaces: {
4
+ virtual_interfaces: [
5
+ {
6
+ owner_account: '123456789012',
7
+ virtual_interface_id: 'dxvif-aabbccdd',
8
+ location: 'AbCD5',
9
+ connection_id: 'dxcon-abcd5fgh',
10
+ virtual_interface_type: 'private',
11
+ virtual_interface_name: 'my-directconnect-virtual-interface',
12
+ vlan: 400,
13
+ asn: 65_007,
14
+ auth_key: nil,
15
+ amazon_address: '170.252.252.1/30',
16
+ customer_address: '123.456.789.2/30',
17
+ virtual_interface_state: 'available',
18
+ customer_router_config: nil,
19
+ virtual_gateway_id: 'vgw-d234e5f6',
20
+ route_filter_prefixes: []
21
+ }
22
+ ]
23
+ }
24
+ }
25
+ }
@@ -0,0 +1,20 @@
1
+ module Awspec::Type
2
+ class DirectconnectVirtualInterface < Base
3
+ def initialize(id)
4
+ super
5
+ @resource = find_virtual_interface(id)
6
+ @id = @resource[:virtual_interface_id] if @resource
7
+ end
8
+
9
+ states = %w(
10
+ confirming verifying pending available
11
+ deleting deleted rejected
12
+ )
13
+
14
+ states.each do |state|
15
+ define_method state + '?' do
16
+ @resource[:virtual_interface_state] == state
17
+ end
18
+ end
19
+ end
20
+ end
@@ -1,3 +1,3 @@
1
1
  module Awspec
2
- VERSION = '0.21.6'
2
+ VERSION = '0.22.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.21.6
4
+ version: 0.22.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - k1LoW
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-17 00:00:00.000000000 Z
11
+ date: 2015-11-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -207,6 +207,7 @@ files:
207
207
  - lib/awspec/generator/doc/type/autoscaling_group.rb
208
208
  - lib/awspec/generator/doc/type/base.rb
209
209
  - lib/awspec/generator/doc/type/cloudwatch_alarm.rb
210
+ - lib/awspec/generator/doc/type/directconnect_virtual_interface.rb
210
211
  - lib/awspec/generator/doc/type/ebs.rb
211
212
  - lib/awspec/generator/doc/type/ec2.rb
212
213
  - lib/awspec/generator/doc/type/elasticache.rb
@@ -228,6 +229,7 @@ files:
228
229
  - lib/awspec/generator/doc/type/subnet.rb
229
230
  - lib/awspec/generator/doc/type/vpc.rb
230
231
  - lib/awspec/generator/spec/cloudwatch_alarm.rb
232
+ - lib/awspec/generator/spec/directconnect.rb
231
233
  - lib/awspec/generator/spec/ec2.rb
232
234
  - lib/awspec/generator/spec/elb.rb
233
235
  - lib/awspec/generator/spec/iam_policy.rb
@@ -245,6 +247,7 @@ files:
245
247
  - lib/awspec/helper/finder.rb
246
248
  - lib/awspec/helper/finder/autoscaling.rb
247
249
  - lib/awspec/helper/finder/cloudwatch.rb
250
+ - lib/awspec/helper/finder/directconnect.rb
248
251
  - lib/awspec/helper/finder/ebs.rb
249
252
  - lib/awspec/helper/finder/ec2.rb
250
253
  - lib/awspec/helper/finder/elasticache.rb
@@ -276,6 +279,7 @@ files:
276
279
  - lib/awspec/stub.rb
277
280
  - lib/awspec/stub/autoscaling_group.rb
278
281
  - lib/awspec/stub/cloudwatch_alarm.rb
282
+ - lib/awspec/stub/directconnect_virtual_interface.rb
279
283
  - lib/awspec/stub/ebs.rb
280
284
  - lib/awspec/stub/ec2.rb
281
285
  - lib/awspec/stub/elasticache.rb
@@ -300,6 +304,7 @@ files:
300
304
  - lib/awspec/type/autoscaling_group.rb
301
305
  - lib/awspec/type/base.rb
302
306
  - lib/awspec/type/cloudwatch_alarm.rb
307
+ - lib/awspec/type/directconnect_virtual_interface.rb
303
308
  - lib/awspec/type/ebs.rb
304
309
  - lib/awspec/type/ec2.rb
305
310
  - lib/awspec/type/elasticache.rb