Skip to content
This repository has been archived by the owner on Sep 9, 2022. It is now read-only.

Commit

Permalink
Do not print access_logs if disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
dtan4 committed Dec 20, 2016
1 parent 25278db commit f73ebb8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 2 additions & 0 deletions lib/terraforming/template/tf/alb.erb
Expand Up @@ -10,12 +10,14 @@ resource "aws_alb" "<%= module_name_of(load_balancer) %>" {

enable_deletion_protection = <%= load_balancer_attributes["deletion_protection.enabled"].to_s %>
<%- if load_balancer_attributes["access_logs.s3.enabled"] == "true" -%>
access_logs {
bucket = "<%= load_balancer_attributes["access_logs.s3.bucket"] %>"
enabled = <%= load_balancer_attributes["access_logs.s3.enabled"] %>
prefix = "<%= load_balancer_attributes["access_logs.s3.prefix"] %>"
}

<%- end -%>
tags {
<% tags.each do |tag| -%>
"<%= tag.key %>" = "<%= tag.value %>"
Expand Down
6 changes: 0 additions & 6 deletions spec/lib/terraforming/resource/alb_spec.rb
Expand Up @@ -128,12 +128,6 @@ module Resource
enable_deletion_protection = true
access_logs {
bucket = "my-elb-logs"
enabled = false
prefix = "fuga"
}
tags {
}
}
Expand Down

0 comments on commit f73ebb8

Please sign in to comment.