Skip to content

Instantly share code, notes, and snippets.

@jleeh
Created January 19, 2019 15:26
Show Gist options
  • Save jleeh/0e41ade30af5ea6dd09fd7aa84cf10d3 to your computer and use it in GitHub Desktop.
Save jleeh/0e41ade30af5ea6dd09fd7aa84cf10d3 to your computer and use it in GitHub Desktop.
variable "mapList" { type = "list" }
data "template_file" "test" {
count = "${length(var.mapList)}"
template = "${lookup(var.mapList[count.index], "key")}=${lookup(var.mapList[count.index], "value")}"
}
output "rendered" {
value = "${data.template_file.test.*.rendered}"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment