From 79bca229dae42cea914c335c1645cc0668790829 Mon Sep 17 00:00:00 2001 From: badra001 Date: Fri, 14 Oct 2022 15:32:24 -0400 Subject: [PATCH] use secrets in tunnel outputs --- vpn-transit-gateway/README.md | 3 ++- vpn-transit-gateway/vpn-config.tf | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/vpn-transit-gateway/README.md b/vpn-transit-gateway/README.md index c2a69a4..1b59334 100644 --- a/vpn-transit-gateway/README.md +++ b/vpn-transit-gateway/README.md @@ -47,6 +47,7 @@ module "vpn_transit-gateway" { | [terraform](#requirement\_terraform) | >= 0.13 | | [aws](#requirement\_aws) | >= 3.66.0 | | [ldap](#requirement\_ldap) | >= 0.5.4 | +| [local](#requirement\_local) | >= 1.0.0 | | [null](#requirement\_null) | >= 3.0 | | [random](#requirement\_random) | >= 3.0 | | [template](#requirement\_template) | >= 2.0 | @@ -56,7 +57,7 @@ module "vpn_transit-gateway" { | Name | Version | |------|---------| | [aws](#provider\_aws) | >= 3.66.0 | -| [local](#provider\_local) | n/a | +| [local](#provider\_local) | >= 1.0.0 | | [null](#provider\_null) | >= 3.0 | | [random](#provider\_random) | >= 3.0 | diff --git a/vpn-transit-gateway/vpn-config.tf b/vpn-transit-gateway/vpn-config.tf index eedd2e2..bbef073 100644 --- a/vpn-transit-gateway/vpn-config.tf +++ b/vpn-transit-gateway/vpn-config.tf @@ -46,8 +46,8 @@ locals { } vpn_tunnel_sites = distinct([for k, v in local.vpn_tunnel_outputs : v.site]) # use tunnel secrets if needed - # vpn_site_tunnel_outputs = { for s in local.vpn_tunnel_sites: s => flatten([ for k,v in local.vpn_tunnel_outputs: merge(v,local.vpn_tunnel_secrets[k]) if v.site=s ]) } - vpn_site_tunnel_outputs = { for s in local.vpn_tunnel_sites : s => flatten([for k, v in local.vpn_tunnel_outputs : v if v.site == s]) } + vpn_site_tunnel_outputs = { for s in local.vpn_tunnel_sites : s => flatten([for k, v in local.vpn_tunnel_outputs : merge(v, local.vpn_tunnel_secrets[k]) if v.site == s]) } + # vpn_site_tunnel_outputs = { for s in local.vpn_tunnel_sites : s => flatten([for k, v in local.vpn_tunnel_outputs : v if v.site == s]) } vpn_site_common_settings = ["account_alias", "account_id", "region", "region_short", "vpc_cidr_block", "vpc_name", "vpc_short_name", "vpn_environment"] }