Skip to content

Commit

Permalink
revert
Browse files Browse the repository at this point in the history
  • Loading branch information
badra001 committed Oct 20, 2022
1 parent 71ae049 commit 0c18132
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
variable "network_account_profile" {
description = "AWS profile of the source account sharing the VPC resources"
type = string
default = null
}

variable "tgw_label" {
Expand Down
9 changes: 3 additions & 6 deletions vpc-transit-gateway-association/peer/associate.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ locals {
# add routes to peer for non-services
#---
resource "aws_ec2_transit_gateway_route" "vpc_peer_own_rt" {
# provider = aws.peer
provider = aws
provider = aws.peer
for_each = { for k in local.selected_rt : k => local.transit_gateway_route_table_ids_peer[k] if k == var.transit_gateway_environment }
destination_cidr_block = data.aws_vpc.vpc.cidr_block

Expand All @@ -23,8 +22,7 @@ resource "aws_ec2_transit_gateway_route" "vpc_peer_own_rt" {
# always add routes to services
#--
resource "aws_ec2_transit_gateway_route" "vpc_peer_common" {
# provider = aws.peer
provider = aws
provider = aws.peer
for_each = { "services" = local.transit_gateway_route_table_ids_peer["services"] }
destination_cidr_block = data.aws_vpc.vpc.cidr_block

Expand All @@ -36,8 +34,7 @@ resource "aws_ec2_transit_gateway_route" "vpc_peer_common" {
# if services, add routes to all other route tables
#--
resource "aws_ec2_transit_gateway_route" "vpc_peer_all" {
# provider = aws.peer
provider = aws
provider = aws.peer
for_each = contains(local.propagate_all_rt, var.transit_gateway_environment) ? { for k in local.selected_rt : k => local.transit_gateway_route_table_ids_peer[k] } : {}
destination_cidr_block = data.aws_vpc.vpc.cidr_block

Expand Down
9 changes: 3 additions & 6 deletions vpc-transit-gateway-association/self/associate.tf
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ resource "aws_ec2_transit_gateway_vpc_attachment" "vpc_attachment" {
# assocaite this vpc to route table in self (my region, network account)
#---
resource "aws_ec2_transit_gateway_route_table_association" "route_table_self" {
provider = aws
# provider = aws.self
provider = aws.self
transit_gateway_attachment_id = aws_ec2_transit_gateway_vpc_attachment.vpc_attachment.id
transit_gateway_route_table_id = local.transit_gateway_route_table_ids_self[var.transit_gateway_environment]
}
Expand All @@ -46,8 +45,7 @@ locals {
# we will cover services and inter-region separately
#---
resource "aws_ec2_transit_gateway_route_table_propagation" "vpc_self_own_rt" {
provider = aws
# provider = aws.self
provider = aws.self
for_each = { for k in local.selected_rt : k => local.transit_gateway_route_table_ids_self[k] }

transit_gateway_attachment_id = aws_ec2_transit_gateway_vpc_attachment.vpc_attachment.id
Expand All @@ -59,8 +57,7 @@ resource "aws_ec2_transit_gateway_route_table_propagation" "vpc_self_own_rt" {
# propagate all to inter-region table
#---
resource "aws_ec2_transit_gateway_route_table_propagation" "vpc_self_common" {
# provider = aws.self
provider = aws
provider = aws.self
for_each = { for k in local.propagate_all_rt : k => local.transit_gateway_route_table_ids_self[k] }

transit_gateway_attachment_id = aws_ec2_transit_gateway_vpc_attachment.vpc_attachment.id
Expand Down

0 comments on commit 0c18132

Please sign in to comment.