Skip to content

Commit

Permalink
force dynamic routing
Browse files Browse the repository at this point in the history
  • Loading branch information
badra001 committed May 3, 2021
1 parent a378c04 commit 2b96d11
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions vpn/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ resource "aws_vpn_gateway" "vpn" {
}

resource "aws_vpn_gateway_attachment" "vpn" {
vpc_id = aws_vpc.vpc.id
vpc_id = var.vpc_id
vpn_gateway_id = aws_vpn_gateway.vpn.id
}

Expand Down Expand Up @@ -100,6 +100,7 @@ resource "random_string" "tunnel_preshared_key" {

#---
# vpn connection, one per vpn endpoint
# at this time, static routing is not an option. We can re-code this later if needed
#---
resource "aws_vpn_connection" "vpn" {
for_each = local.vpn_settings
Expand All @@ -108,7 +109,8 @@ resource "aws_vpn_connection" "vpn" {
customer_gateway_id = aws_customer_gateway.vpn[each.key].id
tunnel1_preshared_key = random_string.tunnel_preshared_key[each.key].result
tunnel2_preshared_key = random_string.tunnel_preshared_key[each.key].result
static_routes_only = var.vpc_vpn_dynamic_routing ? false : true
# static_routes_only = var.vpc_vpn_dynamic_routing ? false : true
static_routes_only = false

tags = merge(
local.base_tags,
Expand Down

0 comments on commit 2b96d11

Please sign in to comment.