diff --git a/vpn-transit-gateway/vpn-config.tf b/vpn-transit-gateway/vpn-config.tf index 4f9294b..4db8876 100644 --- a/vpn-transit-gateway/vpn-config.tf +++ b/vpn-transit-gateway/vpn-config.tf @@ -96,14 +96,14 @@ resource "local_sensitive_file" "vpn_details_yaml" { resource "local_sensitive_file" "vpn_site_details_json" { for_each = var.generate_json_files ? local.vpn_site_tunnel_outputs : {} # content = yamlencode({ version = local._module_version, site = each.key, vpns = each.value }) - content = yamlencode(merge({ version = local._module_version, site = each.key, vpns = each.value }, { for k in local.vpn_site_common_settings : k => each.value[0].k })) + content = jsonencode(merge({ version = local._module_version, site = each.key, vpns = each.value }, { for k in local.vpn_site_common_settings : k => each.value[0][k] })) filename = format("%v/%v/site.%v.%v.%v.json", path.root, null_resource.directory_setup.triggers.name, local.account_id, local.region, each.key) file_permission = "0644" } resource "local_sensitive_file" "vpn_site_details_yaml" { for_each = var.generate_yaml_files ? local.vpn_site_tunnel_outputs : {} - content = yamlencode(merge({ version = local._module_version, site = each.key, vpns = each.value }, { for k in local.vpn_site_common_settings : k => each.value[0].k })) + content = yamlencode(merge({ version = local._module_version, site = each.key, vpns = each.value }, { for k in local.vpn_site_common_settings : k => each.value[0][k] })) filename = format("%v/%v/site.%v.%v.%v.yml", path.root, null_resource.directory_setup.triggers.name, local.account_id, local.region, each.key) file_permission = "0644" }