Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
badra001 committed Jan 30, 2023
1 parent fca069c commit b6dfebf
Showing 1 changed file with 48 additions and 18 deletions.
66 changes: 48 additions & 18 deletions examples/vpc-transit-gateway-attachment/vpc-transit-gateway.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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 } : {},
)
}


Expand All @@ -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" {
Expand All @@ -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]
}

0 comments on commit b6dfebf

Please sign in to comment.