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 +4 -4
- data/lib/awspec/command/generate.rb +1 -1
- data/lib/awspec/generator.rb +1 -0
- data/lib/awspec/generator/spec/alb.rb +38 -0
- data/lib/awspec/helper/finder/alb.rb +1 -1
- data/lib/awspec/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b427b989bf6100b401d096a7d3906c95edae5b5a
|
4
|
+
data.tar.gz: 861da2a929e69e62661052e221fe10f87437e164
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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|
|
data/lib/awspec/generator.rb
CHANGED
@@ -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
|
data/lib/awspec/version.rb
CHANGED
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.
|
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-
|
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
|