Skip to content

Commit

Permalink
add per tunnel label
Browse files Browse the repository at this point in the history
  • Loading branch information
badra001 committed Sep 19, 2022
1 parent 0f9745b commit 3645467
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions vpn-transit-gateway/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ locals {
account_id = var.account_id != "" ? var.account_id : data.aws_caller_identity.current.account_id
account_environment = data.aws_arn.current.partition == "aws-us-gov" ? "gov" : "ew"
region = data.aws_region.current.name
region_short = join("", [for c in split("-", local.region) : substr(c, 0, 1)])

_vpn_settings = [for v in var.tgw_vpn_settings : merge(v, {
site = lower(v.site)
Expand Down
2 changes: 2 additions & 0 deletions vpn-transit-gateway/vpn-config.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ locals {
bgp_asn = aws_customer_gateway.vpn[k].bgp_asn
vpn_connection_id = aws_vpn_connection.vpn[k].id

tunnel1_label = format("%v %v %v %v", aws_vpn_connection.vpn[k].tunnel1_inside_cidr, local.account_id, local.region_short, v.label)
tunnel1_bgp_asn = aws_vpn_connection.vpn[k].tunnel1_bgp_asn
tunnel1_address = aws_vpn_connection.vpn[k].tunnel1_address
tunnel1_inside_cidr = aws_vpn_connection.vpn[k].tunnel1_inside_cidr
Expand All @@ -17,6 +18,7 @@ locals {
tunnel1_interface_number = length(v.tunnel_interfaces) == 2 ? v.tunnel_interfaces[0] : ""
tunnel1_loopback = v.tunnel_loopback != null ? v.tunnel_loopback : ""

tunnel2_label = format("%v %v %v %v", aws_vpn_connection.vpn[k].tunnel2_inside_cidr, local.account_id, local.region_short, v.label)
tunnel2_bgp_asn = aws_vpn_connection.vpn[k].tunnel2_bgp_asn
tunnel2_address = aws_vpn_connection.vpn[k].tunnel2_address
tunnel2_inside_cidr = aws_vpn_connection.vpn[k].tunnel2_inside_cidr
Expand Down

0 comments on commit 3645467

Please sign in to comment.