diff --git a/vpn-transit-gateway/README.md b/vpn-transit-gateway/README.md index b585128..70b8238 100644 --- a/vpn-transit-gateway/README.md +++ b/vpn-transit-gateway/README.md @@ -78,6 +78,8 @@ No modules. | [aws_vpn_connection.vpn](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/vpn_connection) | resource | | [local_sensitive_file.vpn_details_json](https://registry.terraform.io/providers/hashicorp/local/latest/docs/resources/sensitive_file) | resource | | [local_sensitive_file.vpn_details_yaml](https://registry.terraform.io/providers/hashicorp/local/latest/docs/resources/sensitive_file) | resource | +| [local_sensitive_file.vpn_site_details_json](https://registry.terraform.io/providers/hashicorp/local/latest/docs/resources/sensitive_file) | resource | +| [local_sensitive_file.vpn_site_details_yaml](https://registry.terraform.io/providers/hashicorp/local/latest/docs/resources/sensitive_file) | resource | | [null_resource.directory_setup](https://registry.terraform.io/providers/hashicorp/null/latest/docs/resources/resource) | resource | | [null_resource.generate_configs](https://registry.terraform.io/providers/hashicorp/null/latest/docs/resources/resource) | resource | | [random_string.tunnel_preshared_key](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/string) | resource | @@ -121,5 +123,4 @@ No modules. | [customer\_gateway\_arns](#output\_customer\_gateway\_arns) | AWS Customer Gateway ARNs | | [customer\_gateway\_ids](#output\_customer\_gateway\_ids) | AWS Customer Gateway IDs | | [vpn\_labels](#output\_vpn\_labels) | VPN Labels for Description field of Endpoint device (Cisco ASR) | -| [vpn\_site\_tunnel\_outputs](#output\_vpn\_site\_tunnel\_outputs) | n/a | | [vpn\_tunnel\_endpoints](#output\_vpn\_tunnel\_endpoints) | VPN Tunnel Endpoint IP Addresses | diff --git a/vpn-transit-gateway/vpn-config.tf b/vpn-transit-gateway/vpn-config.tf index 07c030a..070e6b8 100644 --- a/vpn-transit-gateway/vpn-config.tf +++ b/vpn-transit-gateway/vpn-config.tf @@ -91,20 +91,20 @@ resource "local_sensitive_file" "vpn_details_yaml" { file_permission = "0644" } -## resource "local_sensitive_file" "vpn_site_details_json" { -## for_each = var.generate_json_files ? local.vpn_site_tunnel_outputs : {} -## content = jsonencode(merge({ version = local._module_version }, tomap(each.value))) -## 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 }, tomap(each.value))) -## 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" -## } +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, each.key = each.value }) + 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" +} -output "vpn_site_tunnel_outputs" { - value = local.vpn_site_tunnel_outputs +resource "local_sensitive_file" "vpn_site_details_yaml" { + for_each = var.generate_yaml_files ? local.vpn_site_tunnel_outputs : {} + content = yamlencode({ version = local._module_version, each.key = each.value }) + 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" } + +## output "vpn_site_tunnel_outputs" { +## value = local.vpn_site_tunnel_outputs +## }