From fe3a9e23775b6d4899f84147da48896bfaa978ff Mon Sep 17 00:00:00 2001 From: Steven Nemetz Date: Mon, 18 Dec 2017 06:17:49 -0800 Subject: [PATCH] Cleanup implementation --- main.tf | 13 +++++++------ test/main.tf | 4 ++++ test/outputs.tf | 3 +++ 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/main.tf b/main.tf index 1880a9c..368b115 100644 --- a/main.tf +++ b/main.tf @@ -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}" } diff --git a/test/main.tf b/test/main.tf index 6ab11ed..5386dd2 100644 --- a/test/main.tf +++ b/test/main.tf @@ -23,3 +23,7 @@ module "false" { source = "../" value = "false" } +module "xyz" { + source = "../" + value = "xyz" +} diff --git a/test/outputs.tf b/test/outputs.tf index 90d4ae4..278512a 100644 --- a/test/outputs.tf +++ b/test/outputs.tf @@ -17,3 +17,6 @@ output "enable" { output "false" { value = "${module.false.value}" } +output "xyz" { + value = "${module.xyz.value}" +}