Skip to content

Instantly share code, notes, and snippets.

@justinclayton
Created May 1, 2018 19:02
Show Gist options
  • Select an option

  • Save justinclayton/d2935f0092618ca7d231f085e0f003a3 to your computer and use it in GitHub Desktop.

Select an option

Save justinclayton/d2935f0092618ca7d231f085e0f003a3 to your computer and use it in GitHub Desktop.

Revisions

  1. justinclayton created this gist May 1, 2018.
    10 changes: 10 additions & 0 deletions hack.tf
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    variable "yes" { default = true }

    data "template_file" "maybe" {
    count = "${ var.yes == false ? 0 : 1 }"
    template = "YES"
    }

    output "maybe" {
    value = "${ var.yes == false ? "" : element(concat(data.template_file.maybe.*.rendered, list("")), 0) }" # <-- :_(
    }