From c73f06264c1d3aaed8004e7f85d7e607ae814eeb Mon Sep 17 00:00:00 2001 From: Marvin Bertram Date: Wed, 9 Oct 2024 16:39:01 +0200 Subject: [PATCH 1/2] Add appliance mode flag for attachment --- .spacelift/config.yml | 2 +- tgw.tf | 7 ++++--- variables.tf | 6 ++++++ 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.spacelift/config.yml b/.spacelift/config.yml index 8ec282938..279a9441a 100644 --- a/.spacelift/config.yml +++ b/.spacelift/config.yml @@ -1,4 +1,4 @@ version: 1 -module_version: 0.3.5 +module_version: 0.3.6 diff --git a/tgw.tf b/tgw.tf index 4c856123a..c19745fa6 100644 --- a/tgw.tf +++ b/tgw.tf @@ -157,9 +157,10 @@ resource "aws_network_acl_rule" "tgw_outbound" { resource "aws_ec2_transit_gateway_vpc_attachment" "tgw" { count = var.enable_tgw_attachment ? 1 : 0 - subnet_ids = aws_subnet.tgw[*].id - transit_gateway_id = var.transit_gateway_id - vpc_id = local.vpc_id + subnet_ids = aws_subnet.tgw[*].id + transit_gateway_id = var.transit_gateway_id + vpc_id = local.vpc_id + appliance_mode_support = var.enable_appliance_mode_support tags = merge( { Name = "${var.name_prefix}-${var.short_aws_region}-tgw-att-${var.tgw_att_suffix}" } diff --git a/variables.tf b/variables.tf index 453578a24..a27646a81 100644 --- a/variables.tf +++ b/variables.tf @@ -1796,6 +1796,12 @@ variable "create_multiple_tgw_route_tables" { default = true } +variable "enable_appliance_mode_support" { + description = "Enable/disable support for appliance mode for the TGW attachment. Default:; `false`" + type = bool + default = false +} + ################################################################################ # TGW Network ACLs ################################################################################ From 0bcc9fcfa485a8825cf6d713d5e47b94e03c73ce Mon Sep 17 00:00:00 2001 From: Marvin Bertram Date: Wed, 9 Oct 2024 16:54:16 +0200 Subject: [PATCH 2/2] Add check for appliance mode flag --- tgw.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tgw.tf b/tgw.tf index c19745fa6..fa591fc77 100644 --- a/tgw.tf +++ b/tgw.tf @@ -160,7 +160,7 @@ resource "aws_ec2_transit_gateway_vpc_attachment" "tgw" { subnet_ids = aws_subnet.tgw[*].id transit_gateway_id = var.transit_gateway_id vpc_id = local.vpc_id - appliance_mode_support = var.enable_appliance_mode_support + appliance_mode_support = try(var.enable_appliance_mode_support, false) ? "enable" : "disable" tags = merge( { Name = "${var.name_prefix}-${var.short_aws_region}-tgw-att-${var.tgw_att_suffix}" }