Skip to content

Commit

Permalink
bugfix when tgw is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
Benbentwo committed Oct 7, 2024
1 parent d4c4947 commit 010881d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ locals {
transit_gateway_enabled = local.enabled && var.transit_gateway_enabled

transit_gateway_attachment_id = join("", aws_vpn_connection.default[*].transit_gateway_attachment_id)
vpn_gateway_id = join("", aws_vpn_gateway.default[*].id)
vpn_gateway_id = one(aws_vpn_gateway.default[*].id)
customer_gateway_id = join("", aws_customer_gateway.default[*].id)
vpn_connection_id = join("", aws_vpn_connection.default[*].id)
}
Expand Down Expand Up @@ -96,7 +96,7 @@ resource "aws_vpn_connection" "default" {

# https://www.terraform.io/docs/providers/aws/r/vpn_gateway_route_propagation.html
resource "aws_vpn_gateway_route_propagation" "default" {
count = local.enabled ? length(var.route_table_ids) : 0
count = local.enabled && !var.transit_gateway_enabled ? length(var.route_table_ids) : 0
vpn_gateway_id = local.vpn_gateway_id
route_table_id = element(var.route_table_ids, count.index)
}
Expand Down

0 comments on commit 010881d

Please sign in to comment.