Skip to content

Commit

Permalink
Merge pull request #427 from htnosm/pr-add-autoscaling_group-generate
Browse files Browse the repository at this point in the history
Add have_nlb_target_group to generator for autoscaling_group
  • Loading branch information
inokappa authored Dec 15, 2018
2 parents a0dc72a + 4570625 commit 113552a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/awspec/generator/spec/autoscaling_group.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,12 @@ def autoscaling_group_spec_template
<% autoscaling_group[:load_balancer_names].each do |desc| %>
it { should have_elb('<%= desc %>') }
<% end %>
<% autoscaling_group[:target_group_arns].each do |desc| %>
it { should have_alb_target_group('<%= desc.sub(/^.*targetgroup\/(.[^\/]*).*$/, '\1') %>') }
<% autoscaling_group[:target_group_arns].join(",").gsub(/arn:.+?:targetgroup\/(.[^\/]*)\/.[^,]*/, '\1').split(",").each do |desc| %>
<%- if not find_alb_target_group(desc).nil? -%>
it { should have_alb_target_group('<%= desc %>') }
<%- elsif not find_nlb_target_group(desc).nil? -%>
it { should have_nlb_target_group('<%= desc %>') }
<%- end -%>
<% end %>
end
EOF
Expand Down

0 comments on commit 113552a

Please sign in to comment.