terraform { required_version = "> 0.8.0" } variable "nginx_sites" { type = map(object({ service = string proxy_cache = bool extra-value = string extra_value_bool = bool http2_bool = bool })) } resource "local_file" "nginx"{ for_each = var.nginx_sites content = templatefile("nginx_config.tftpl", { name_site = each.key name_service = each.value.service proxy_cache = each.value.proxy_cache extra_value_bool = each.value.extra_value_bool extra-value = each.value.extra-value http2_bool = each.value.http2_bool }) filename = "../conf.d/${each.key}.tryton.geeraert.eu.conf" }