File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -87,8 +87,8 @@ module "tgw_peer" {
87
87
description = " My TGW shared with several other AWS accounts"
88
88
amazon_side_asn = 64532
89
89
90
- share_tgw = true
91
90
create_tgw = false
91
+ share_tgw = true
92
92
ram_resource_share_arn = module. tgw . ram_resource_share_id
93
93
enable_auto_accept_shared_attachments = true # When "true" there is no need for RAM resources if using multiple AWS accounts
94
94
Original file line number Diff line number Diff line change 1
1
locals {
2
2
# List of maps with key and route values
3
3
vpc_attachments_with_routes = chunklist (flatten ([
4
- for k , v in var . vpc_attachments : setproduct ([{ key = k }], v. tgw_routes ) if can (v. tgw_routes )
4
+ for k , v in var . vpc_attachments : setproduct ([{ key = k }], v. tgw_routes ) if var . create_tgw && can (v. tgw_routes )
5
5
]), 2 )
6
6
7
7
tgw_default_route_table_tags_merged = merge (
@@ -110,7 +110,7 @@ resource "aws_route" "this" {
110
110
111
111
resource "aws_ec2_transit_gateway_route_table_association" "this" {
112
112
for_each = {
113
- for k , v in var . vpc_attachments : k => v if try (v. transit_gateway_default_route_table_association , true ) != true
113
+ for k , v in var . vpc_attachments : k => v if var . create_tgw && try (v. transit_gateway_default_route_table_association , true ) != true
114
114
}
115
115
116
116
# Create association if it was not set already by aws_ec2_transit_gateway_vpc_attachment resource
@@ -120,7 +120,7 @@ resource "aws_ec2_transit_gateway_route_table_association" "this" {
120
120
121
121
resource "aws_ec2_transit_gateway_route_table_propagation" "this" {
122
122
for_each = {
123
- for k , v in var . vpc_attachments : k => v if try (v. transit_gateway_default_route_table_propagation , true ) != true
123
+ for k , v in var . vpc_attachments : k => v if var . create_tgw && try (v. transit_gateway_default_route_table_propagation , true ) != true
124
124
}
125
125
126
126
# Create association if it was not set already by aws_ec2_transit_gateway_vpc_attachment resource
You can’t perform that action at this time.
0 commit comments