Skip to content

Commit

Permalink
add inside cidr, cgw and vgw addresses
Browse files Browse the repository at this point in the history
  • Loading branch information
badra001 committed May 31, 2023
1 parent 1331829 commit bfd9b8c
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 41 deletions.
87 changes: 47 additions & 40 deletions vpn-transit-gateway/cloudwatch_alarms.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,48 +4,54 @@

locals {
vpn_t1_details = { for k, v in local.vpn_tunnel_outputs : format("%v:1", k) => {
tunnel_number = 1
name = format("%v-tunnel-%v.%v.%v", v.label, 1, v.account_alias, v.region)
account_alias = v.account_alias
account_id = v.account_id
customer_address = v.customer_address
full_label = v.full_label
label = v.label
region = v.region
sequence = v.sequence
site = v.site
tunnel_address = v.tunnel1_address
interface_number = v.tunnel1_interface_number
tunnel_label = v.tunnel1_label
loopback = v.tunnel1_loopback
vpc_id = var.vpc_id
cidr_block = v.vpc_cidr_block
vpc_short_name = v.vpc_short_name
vpc_name = v.vpc_name
vpn_environment = v.vpn_environment
vpn_connection_id = v.vpn_connection_id
tunnel_number = 1
name = format("%v-tunnel-%v.%v.%v", v.label, 1, v.account_alias, v.region)
account_alias = v.account_alias
account_id = v.account_id
customer_address = v.customer_address
full_label = v.full_label
label = v.label
region = v.region
sequence = v.sequence
site = v.site
inside_cidr = v.tunnel1_inside_cidr
cgw_inside_address = v.tunnel1_cgw_inside_address
vgw_inside_address = v.tunnel1_vgw_inside_address
tunnel_address = v.tunnel1_address
interface_number = v.tunnel1_interface_number
tunnel_label = v.tunnel1_label
loopback = v.tunnel1_loopback
vpc_id = var.vpc_id
cidr_block = v.vpc_cidr_block
vpc_short_name = v.vpc_short_name
vpc_name = v.vpc_name
vpn_environment = v.vpn_environment
vpn_connection_id = v.vpn_connection_id
} }
vpn_t2_details = { for k, v in local.vpn_tunnel_outputs : format("%v:2", k) => {
tunnel_number = 2
name = format("%v-tunnel-%v.%v.%v", v.label, 2, v.account_alias, v.region)
account_alias = v.account_alias
account_id = v.account_id
customer_address = v.customer_address
full_label = v.full_label
label = v.label
region = v.region
sequence = v.sequence
site = v.site
tunnel_address = v.tunnel2_address
interface_number = v.tunnel2_interface_number
tunnel_label = v.tunnel2_label
loopback = v.tunnel2_loopback
vpc_id = var.vpc_id
cidr_block = v.vpc_cidr_block
vpc_short_name = v.vpc_short_name
vpc_name = v.vpc_name
vpn_environment = v.vpn_environment
vpn_connection_id = v.vpn_connection_id
tunnel_number = 2
name = format("%v-tunnel-%v.%v.%v", v.label, 2, v.account_alias, v.region)
account_alias = v.account_alias
account_id = v.account_id
customer_address = v.customer_address
full_label = v.full_label
label = v.label
region = v.region
sequence = v.sequence
site = v.site
inside_cidr = v.tunnel2_inside_cidr
cgw_inside_address = v.tunnel2_cgw_inside_address
vgw_inside_address = v.tunnel2_vgw_inside_address
tunnel_address = v.tunnel2_address
interface_number = v.tunnel2_interface_number
tunnel_label = v.tunnel2_label
loopback = v.tunnel2_loopback
vpc_id = var.vpc_id
cidr_block = v.vpc_cidr_block
vpc_short_name = v.vpc_short_name
vpc_name = v.vpc_name
vpn_environment = v.vpn_environment
vpn_connection_id = v.vpn_connection_id
} }
vpn_details = merge(local.vpn_t1_details, local.vpn_t2_details)
}
Expand Down Expand Up @@ -95,3 +101,4 @@ resource "aws_cloudwatch_composite_alarm" "tgw_vpn_site" {
var.tags,
)
}

Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* loopback = ${site_details[0].loopback}
* endpoint = ${site_details[0].customer_address}
%{ for t in site_details ~}
* ${t.tunnel_address} ${t.tunnel_number} ${t.interface_number}
* ${t.tunnel_number} ${t.inside_cidr} interface ${t.interface_number}
%{ endfor ~}

_version = ${module_name} ${module_version}_

0 comments on commit bfd9b8c

Please sign in to comment.