awspec 0.73.2 → 0.74.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: f6bd0b2085bd7ae739cea83dd5f2713235eb3bde
4
- data.tar.gz: 3acda26007092f63eda0f5d5d0b23c7aba07f622
3
+ metadata.gz: b427b989bf6100b401d096a7d3906c95edae5b5a
4
+ data.tar.gz: 861da2a929e69e62661052e221fe10f87437e164
5
5
  SHA512:
6
- metadata.gz: a8fb6fab06cf538c72b19c57d7e0555eb555d6d1e5df311855003050b2ed5edceab6a6f8bc9826c00d0a042597ea9cba421beda05730f2e88e6e31ed3eed8d5e
7
- data.tar.gz: 9dfeb8d62661b6064eeee9a7f39908079ac1d5861326f59e461c8e7a67630ab9e6ff8f09674530352ae35670a988bd4bd54633e4704a57b2c26b9b438f94674d
6
+ metadata.gz: cd34ec0b9c04287b8537c49dcbf30a00ae9f9ef06eab690b2e906bd5bba7c53a6b99dd288a5052936c12297f93b2c7bf25474afd3eaf0bb38a48c9d01327a928
7
+ data.tar.gz: 31d822ea897c999dc6db1a6f85035091e9f24c53437ed1a6edb143b6650c89a8c2efe971a9b829fd341877aac1b49d737f15301bb213ed5aab013a9687358deb
@@ -8,7 +8,7 @@ module Awspec
8
8
  class_option :secrets_path, default: 'secrets.yml'
9
9
 
10
10
  types = %w(
11
- vpc ec2 rds security_group elb network_acl route_table subnet nat_gateway network_interface
11
+ vpc ec2 rds security_group elb network_acl route_table subnet nat_gateway network_interface alb
12
12
  )
13
13
 
14
14
  types.each do |type|
@@ -24,6 +24,7 @@ require 'awspec/generator/spec/iam_group'
24
24
  require 'awspec/generator/spec/iam_role'
25
25
  require 'awspec/generator/spec/acm'
26
26
  require 'awspec/generator/spec/cloudwatch_logs'
27
+ require 'awspec/generator/spec/alb'
27
28
 
28
29
  # Doc
29
30
  require 'awspec/generator/doc/type'
@@ -0,0 +1,38 @@
1
+ module Awspec::Generator
2
+ module Spec
3
+ class Alb
4
+ include Awspec::Helper::Finder
5
+ def generate_by_vpc_id(vpc_id)
6
+ describes = %w(
7
+ load_balancer_name
8
+ )
9
+ vpc = find_vpc(vpc_id)
10
+ raise 'Not Found VPC' unless vpc
11
+ @vpc_id = vpc[:vpc_id]
12
+ @vpc_tag_name = vpc.tag_name
13
+ albs = select_alb_by_vpc_id(@vpc_id)
14
+
15
+ specs = albs.map do |alb|
16
+ content = ERB.new(alb_spec_template, nil, '-').result(binding).gsub(/^\n/, '')
17
+ end
18
+ specs.join("\n")
19
+ end
20
+
21
+ def alb_spec_template
22
+ template = <<-'EOF'
23
+ describe alb('<%= alb.load_balancer_name %>') do
24
+ it { should exist }
25
+ its(:load_balancer_arn) { should eq '<%= alb.load_balancer_arn %>' }
26
+ its(:dns_name) { should eq '<%= alb.dns_name %>' }
27
+ its(:load_balancer_name) { should eq '<%= alb.load_balancer_name %>' }
28
+ its(:scheme) { should eq '<%= alb.scheme %>' }
29
+ its(:vpc_id) { should eq '<%= alb.vpc_id %>' }
30
+ its(:type) { should eq '<%= alb.type %>' }
31
+ its(:ip_address_type) { should eq '<%= alb.ip_address_type %>' }
32
+ end
33
+ EOF
34
+ template
35
+ end
36
+ end
37
+ end
38
+ end
@@ -10,7 +10,7 @@ module Awspec::Helper
10
10
 
11
11
  def select_alb_by_vpc_id(vpc_id)
12
12
  res = elbv2_client.describe_load_balancers
13
- res.load_balancer_descriptions.select do |lb|
13
+ res.load_balancers.select do |lb|
14
14
  lb.vpc_id == vpc_id
15
15
  end
16
16
  end
@@ -1,3 +1,3 @@
1
1
  module Awspec
2
- VERSION = '0.73.2'
2
+ VERSION = '0.74.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.73.2
4
+ version: 0.74.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - k1LoW
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-04-03 00:00:00.000000000 Z
11
+ date: 2017-04-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -328,6 +328,7 @@ files:
328
328
  - lib/awspec/generator/doc/type/vpn_gateway.rb
329
329
  - lib/awspec/generator/doc/type/waf_web_acl.rb
330
330
  - lib/awspec/generator/spec/acm.rb
331
+ - lib/awspec/generator/spec/alb.rb
331
332
  - lib/awspec/generator/spec/cloudwatch_alarm.rb
332
333
  - lib/awspec/generator/spec/cloudwatch_event.rb
333
334
  - lib/awspec/generator/spec/cloudwatch_logs.rb