From b6dfebf84e77bba08ecd1c7b296685175515ec4a Mon Sep 17 00:00:00 2001 From: badra001 Date: Mon, 30 Jan 2023 15:58:15 -0500 Subject: [PATCH] fix --- .../vpc-transit-gateway.tf | 66 ++++++++++++++----- 1 file changed, 48 insertions(+), 18 deletions(-) diff --git a/examples/vpc-transit-gateway-attachment/vpc-transit-gateway.tf b/examples/vpc-transit-gateway-attachment/vpc-transit-gateway.tf index 8d8596a..3a9bf00 100644 --- a/examples/vpc-transit-gateway-attachment/vpc-transit-gateway.tf +++ b/examples/vpc-transit-gateway-attachment/vpc-transit-gateway.tf @@ -12,16 +12,24 @@ module "vpc_tgw_data" { aws.peer = aws.tgw_peer } - network_account_profile = var.network_account_profile - vpc_id = local.vpc_id - vpc_cidr_block = var.vpc_cidr_block - vpc_full_name = var.vpc_full_name - private_subnets_ids = [for sn in module.subnets.private_subnets_ids : sn if lookup(sn.tags, "boc:vpc:route-table", null) == "attachment"] - private_route_table_ids = module.routing.private_route_table_ids + network_account_profile = var.network_account_profile + vpc_id = local.vpc_id + vpc_cidr_block = var.vpc_cidr_block + vpc_full_name = var.vpc_full_name + # private_subnets_ids = [for sn in module.subnets.private_subnets_ids : sn if lookup(sn.tags, "boc:vpc:route-table", null) == "attachment"] + # private_route_table_ids = module.routing.private_route_table_ids + private_subnets_ids = [for sn in local.private_subnets_ids : sn if lookup(sn.tags, "boc:vpc:route-table", null) == "attachment"] + private_route_table_ids = local.private_route_table_ids transit_gateway_environment = var.tgw_environment transit_gateway_label = var.tgw_label route_prefix_list_name = format("transit-gateway.%v", var.tgw_label) vpn_route_prefix_list_name = format("vpn-transit-gateway.%v", var.tgw_label) + + tags = merge( + local.common_tags, + var.tgw_label != null ? { "boc:tgw:environment" = var.tgw_label } : {}, + # var.shared_vpc_label!=null ? { "boc:network_shared"= var.shared_vpc_label } : {}, + ) } @@ -38,17 +46,28 @@ module "vpc_tgw_self" { } count = var.tgw_environment != null ? 1 : 0 - network_account_profile = var.network_account_profile - vpc_id = local.vpc_id - vpc_cidr_block = var.vpc_cidr_block - vpc_full_name = var.vpc_full_name - private_subnets_ids = [for sn in module.subnets.private_subnets_ids : sn if lookup(sn.tags, "boc:vpc:route-table", null) == "attachment"] - private_route_table_ids = module.routing.private_route_table_ids + network_account_profile = var.network_account_profile + vpc_id = local.vpc_id + vpc_cidr_block = var.vpc_cidr_block + vpc_full_name = var.vpc_full_name + # private_subnets_ids = [for sn in module.subnets.private_subnets_ids : sn if lookup(sn.tags, "boc:vpc:route-table", null) == "attachment"] + # private_route_table_ids = module.routing.private_route_table_ids + private_subnets_ids = [for sn in local.private_subnets_ids : sn if lookup(sn.tags, "boc:vpc:route-table", null) == "attachment"] + private_route_table_ids = local.private_route_table_ids transit_gateway_environment = var.tgw_environment transit_gateway_label = var.tgw_label route_prefix_list_name = format("transit-gateway.%v", var.tgw_label) vpn_route_prefix_list_name = format("vpn-transit-gateway.%v", var.tgw_label) data_input = module.vpc_tgw_data.data_output + enable_vpn_routing = true + # create_prefix_list_routing = false + # create_static_peer_routing = false + + tags = merge( + local.common_tags, + var.tgw_label != null ? { "boc:tgw:environment" = var.tgw_label } : {}, + # var.shared_vpc_label!=null ? { "boc:network_shared"= var.shared_vpc_label } : {}, + ) } module "vpc_tgw_peer" { @@ -61,17 +80,28 @@ module "vpc_tgw_peer" { } count = var.tgw_environment != null ? 1 : 0 - network_account_profile = var.network_account_profile - vpc_id = local.vpc_id - vpc_cidr_block = var.vpc_cidr_block - vpc_full_name = var.vpc_full_name - private_subnets_ids = [for sn in module.subnets.private_subnets_ids : sn if lookup(sn.tags, "boc:vpc:route-table", null) == "attachment"] - private_route_table_ids = module.routing.private_route_table_ids + network_account_profile = var.network_account_profile + vpc_id = local.vpc_id + vpc_cidr_block = var.vpc_cidr_block + vpc_full_name = var.vpc_full_name + # private_subnets_ids = [for sn in module.subnets.private_subnets_ids : sn if lookup(sn.tags, "boc:vpc:route-table", null) == "attachment"] + # private_route_table_ids = module.routing.private_route_table_ids + private_subnets_ids = [for sn in local.private_subnets_ids : sn if lookup(sn.tags, "boc:vpc:route-table", null) == "attachment"] + private_route_table_ids = local.private_route_table_ids transit_gateway_environment = var.tgw_environment transit_gateway_label = var.tgw_label route_prefix_list_name = format("transit-gateway.%v", var.tgw_label) vpn_route_prefix_list_name = format("vpn-transit-gateway.%v", var.tgw_label) data_input = module.vpc_tgw_data.data_output + enable_vpn_routing = true + # create_prefix_list_routing = false + # create_static_peer_routing = false + + tags = merge( + local.common_tags, + var.tgw_label != null ? { "boc:tgw:environment" = var.tgw_label } : {}, + # var.shared_vpc_label!=null ? { "boc:network_shared"= var.shared_vpc_label } : {}, + ) depends_on = [module.vpc_tgw_self] }