Skip to content

Commit fe3a9e2

Browse files
committed
Cleanup implementation
1 parent e4b00a3 commit fe3a9e2

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

main.tf

+7-6
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@
44

55
locals {
66
l = "${lower(var.value)}"
7-
v1 = "${local.l == "true" ? 1 : 0}"
8-
v2 = "${local.v1 ? 1 : local.l == "t" ? 1 : 0}"
9-
v3 = "${local.v2 ? 1 : local.l == "1" ? 1 : 0}"
10-
v4 = "${local.v3 ? 1 : local.l == "on" ? 1 : 0}"
11-
v5 = "${local.v4 ? 1 : local.l == "enable" ? 1 : 0}"
12-
value = "${local.v5}"
7+
value = "${
8+
local.l == "true" ||
9+
local.l == "t" ||
10+
local.l == "1" ||
11+
local.l == "on" ||
12+
local.l == "enable"
13+
? 1 : 0}"
1314
}

test/main.tf

+4
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,7 @@ module "false" {
2323
source = "../"
2424
value = "false"
2525
}
26+
module "xyz" {
27+
source = "../"
28+
value = "xyz"
29+
}

test/outputs.tf

+3
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,6 @@ output "enable" {
1717
output "false" {
1818
value = "${module.false.value}"
1919
}
20+
output "xyz" {
21+
value = "${module.xyz.value}"
22+
}

0 commit comments

Comments
 (0)