From 21726a6e640b8c0fd98e175bec8117db754206df Mon Sep 17 00:00:00 2001 From: badra001 Date: Tue, 19 Oct 2021 16:36:38 -0400 Subject: [PATCH] update output --- vpn/main.tf | 1 + vpn/outputs.tf | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/vpn/main.tf b/vpn/main.tf index 31be1aa..0fca4bf 100644 --- a/vpn/main.tf +++ b/vpn/main.tf @@ -49,6 +49,7 @@ locals { bgp_asn_id = v.bgp_asn_id ip_address = v.ip_address } } + _vpn_settings = var.create ? local.vpn_settings : {} base_tags = { "boc:tf_module_version" = local._module_version diff --git a/vpn/outputs.tf b/vpn/outputs.tf index 690591c..3fb3a1b 100644 --- a/vpn/outputs.tf +++ b/vpn/outputs.tf @@ -1,6 +1,6 @@ output "vpn_tunnel_endpoints" { description = "VPN Tunnel Endpoint IP Addresses" - value = { for k in keys(local.vpn_settings) : k => { + value = { for k in keys(local._vpn_settings) : k => { site = k customer_address = aws_customer_gateway.vpn[k].ip_address bgp_asn = aws_customer_gateway.vpn[k].bgp_asn @@ -14,7 +14,7 @@ output "vpn_tunnel_endpoints" { output "vpn_labels" { description = "VPN Labels for Description field of Endpoint device (Cisco ASR)" - value = { for k in keys(local.vpn_settings) : k => { + value = { for k in keys(local._vpn_settings) : k => { site = k label = format("aws:%v:%v:%v:%v", local.region, local.account_id, aws_vpn_connection.vpn[k].id, var.vpc_full_name) }