|
@@ -0,0 +1,60 @@
|
|
|
+# Some of this is redundant or not generated from this module, but it's a nice
|
|
|
+# centralized place to get all of the data needed to setup the VPN connections.
|
|
|
+output vpn_info {
|
|
|
+ value = [
|
|
|
+ for index, connection in aws_vpn_connection.xdr_vpn:
|
|
|
+ {
|
|
|
+ "cgw_public_ip" = var.xdr_interconnect_public_ips[index]
|
|
|
+ "vgw_public_ips" = [
|
|
|
+ connection.tunnel1_address,
|
|
|
+ connection.tunnel2_address
|
|
|
+ ],
|
|
|
+ "cgw_inside_address" = [
|
|
|
+ connection.tunnel1_cgw_inside_address,
|
|
|
+ connection.tunnel2_cgw_inside_address
|
|
|
+ ],
|
|
|
+ "vgw_inside_address" = [
|
|
|
+ connection.tunnel1_vgw_inside_address,
|
|
|
+ connection.tunnel2_vgw_inside_address
|
|
|
+ ]
|
|
|
+ "preshared_key" = [
|
|
|
+ connection.tunnel1_preshared_key,
|
|
|
+ connection.tunnel2_preshared_key
|
|
|
+ ]
|
|
|
+ "vgw_bgp_asn" = connection.tunnel1_bgp_asn, # Tunnel 1 and 2 are same
|
|
|
+ "cgw_bgp_asn" = var.xdr_interconnect_asn
|
|
|
+ }
|
|
|
+ ]
|
|
|
+}
|
|
|
+
|
|
|
+output yaml {
|
|
|
+ # The contents are the same as above, in an environment key
|
|
|
+ value = yamlencode({
|
|
|
+ "" = {
|
|
|
+ (var.aws_partition_alias) = [
|
|
|
+ for index, connection in aws_vpn_connection.xdr_vpn:
|
|
|
+ {
|
|
|
+ "cgw_public_ip" = var.xdr_interconnect_public_ips[index]
|
|
|
+ "vgw_public_ips" = [
|
|
|
+ connection.tunnel1_address,
|
|
|
+ connection.tunnel2_address
|
|
|
+ ],
|
|
|
+ "cgw_inside_address" = [
|
|
|
+ connection.tunnel1_cgw_inside_address,
|
|
|
+ connection.tunnel2_cgw_inside_address
|
|
|
+ ],
|
|
|
+ "vgw_inside_address" = [
|
|
|
+ connection.tunnel1_vgw_inside_address,
|
|
|
+ connection.tunnel2_vgw_inside_address
|
|
|
+ ]
|
|
|
+ "preshared_key" = [
|
|
|
+ connection.tunnel1_preshared_key,
|
|
|
+ connection.tunnel2_preshared_key
|
|
|
+ ]
|
|
|
+ "vgw_bgp_asn" = connection.tunnel1_bgp_asn, # Tunnel 1 and 2 are same
|
|
|
+ "cgw_bgp_asn" = var.xdr_interconnect_asn
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|