diff --git a/vpn-transit-gateway/cloudwatch_alarms.tf b/vpn-transit-gateway/cloudwatch_alarms.tf index d924470..90484db 100644 --- a/vpn-transit-gateway/cloudwatch_alarms.tf +++ b/vpn-transit-gateway/cloudwatch_alarms.tf @@ -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) } @@ -95,3 +101,4 @@ resource "aws_cloudwatch_composite_alarm" "tgw_vpn_site" { var.tags, ) } + diff --git a/vpn-transit-gateway/templates/vpn_tunnel_status_composite_site.alarm.tpl b/vpn-transit-gateway/templates/vpn_tunnel_status_composite_site.alarm.tpl index ade8e3a..4ef5a71 100644 --- a/vpn-transit-gateway/templates/vpn_tunnel_status_composite_site.alarm.tpl +++ b/vpn-transit-gateway/templates/vpn_tunnel_status_composite_site.alarm.tpl @@ -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}_