Skip to content

Commit

Permalink
Cleanup implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
snemetz committed Dec 18, 2017
1 parent e4b00a3 commit fe3a9e2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
13 changes: 7 additions & 6 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@

locals {
l = "${lower(var.value)}"
v1 = "${local.l == "true" ? 1 : 0}"
v2 = "${local.v1 ? 1 : local.l == "t" ? 1 : 0}"
v3 = "${local.v2 ? 1 : local.l == "1" ? 1 : 0}"
v4 = "${local.v3 ? 1 : local.l == "on" ? 1 : 0}"
v5 = "${local.v4 ? 1 : local.l == "enable" ? 1 : 0}"
value = "${local.v5}"
value = "${
local.l == "true" ||
local.l == "t" ||
local.l == "1" ||
local.l == "on" ||
local.l == "enable"
? 1 : 0}"
}
4 changes: 4 additions & 0 deletions test/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,7 @@ module "false" {
source = "../"
value = "false"
}
module "xyz" {
source = "../"
value = "xyz"
}
3 changes: 3 additions & 0 deletions test/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ output "enable" {
output "false" {
value = "${module.false.value}"
}
output "xyz" {
value = "${module.xyz.value}"
}

0 comments on commit fe3a9e2

Please sign in to comment.