Skip to content

Commit

Permalink
feat!: Enable acceleration support, raies MSV or Terraform and AWS pr…
Browse files Browse the repository at this point in the history
…ovider (#99)

Co-authored-by: Bryant Biggs <[email protected]>
  • Loading branch information
james-martinez and bryantbiggs authored Dec 20, 2024
1 parent 139920a commit 4f7c4d2
Show file tree
Hide file tree
Showing 16 changed files with 52 additions and 39 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.96.1
rev: v1.96.2
hooks:
- id: terraform_fmt
- id: terraform_docs
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,14 +243,14 @@ module "tgw" {

| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.66 |
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.3 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.42 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 4.66 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.42 |

## Modules

Expand Down Expand Up @@ -325,6 +325,7 @@ No modules.
| <a name="input_vpc_id"></a> [vpc\_id](#input\_vpc\_id) | The id of the VPC where the VPN Gateway lives. | `string` | `null` | no |
| <a name="input_vpc_subnet_route_table_count"></a> [vpc\_subnet\_route\_table\_count](#input\_vpc\_subnet\_route\_table\_count) | The number of subnet route table ids being passed in via `vpc_subnet_route_table_ids`. | `number` | `0` | no |
| <a name="input_vpc_subnet_route_table_ids"></a> [vpc\_subnet\_route\_table\_ids](#input\_vpc\_subnet\_route\_table\_ids) | The ids of the VPC subnets for which routes from the VPN Gateway will be propagated. | `list(string)` | `[]` | no |
| <a name="input_vpn_connection_enable_acceleration"></a> [vpn\_connection\_enable\_acceleration](#input\_vpn\_connection\_enable\_acceleration) | Indicate whether to enable acceleration for the VPN connection. Supports only EC2 Transit Gateway. | `bool` | `null` | no |
| <a name="input_vpn_connection_static_routes_destinations"></a> [vpn\_connection\_static\_routes\_destinations](#input\_vpn\_connection\_static\_routes\_destinations) | List of CIDRs to be used as destination for static routes (used with `vpn_connection_static_routes_only = true`). Routes to destinations set here will be propagated to the routing tables of the subnets defined in `vpc_subnet_route_table_ids`. | `list(string)` | `[]` | no |
| <a name="input_vpn_connection_static_routes_only"></a> [vpn\_connection\_static\_routes\_only](#input\_vpn\_connection\_static\_routes\_only) | Set to true for the created VPN connection to use static routes exclusively (only if `create_vpn_connection = true`). Static routes must be used for devices that don't support BGP. | `bool` | `false` | no |
| <a name="input_vpn_gateway_id"></a> [vpn\_gateway\_id](#input\_vpn\_gateway\_id) | The id of the VPN Gateway. | `string` | `null` | no |
Expand Down
6 changes: 3 additions & 3 deletions examples/complete-dual-vpn-gateway/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ Run `terraform destroy` when you don't need these resources.

| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.66 |
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.3 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.42 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 4.66 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.42 |

## Modules

Expand Down
4 changes: 2 additions & 2 deletions examples/complete-dual-vpn-gateway/versions.tf
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
terraform {
required_version = ">= 1.0"
required_version = ">= 1.3"

required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 4.66"
version = ">= 5.42"
}
}
}
6 changes: 3 additions & 3 deletions examples/complete-vpn-connection-transit-gateway/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ Run `terraform destroy` when you don't need these resources.

| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.66 |
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.3 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.42 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 4.66 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.42 |

## Modules

Expand Down
10 changes: 6 additions & 4 deletions examples/complete-vpn-connection-transit-gateway/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ module "vpn_gateway_1" {
tunnel1_preshared_key = "1234567890abcdefghijklmn"
tunnel2_preshared_key = "abcdefghijklmn1234567890"

create_vpn_gateway_attachment = false
connect_to_transit_gateway = true
create_vpn_gateway_attachment = false
connect_to_transit_gateway = true
vpn_connection_enable_acceleration = true

tags = {
key1 = "example value 1"
Expand All @@ -41,8 +42,9 @@ module "vpn_gateway_2" {
tunnel1_preshared_key = "1234567890abcdefghijklmn"
tunnel2_preshared_key = "abcdefghijklmn1234567890"

create_vpn_gateway_attachment = false
connect_to_transit_gateway = true
create_vpn_gateway_attachment = false
connect_to_transit_gateway = true
vpn_connection_enable_acceleration = true

tags = {
vpn2a = "example value 1"
Expand Down
4 changes: 2 additions & 2 deletions examples/complete-vpn-connection-transit-gateway/versions.tf
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
terraform {
required_version = ">= 1.0"
required_version = ">= 1.3"

required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 4.66"
version = ">= 5.42"
}
}
}
6 changes: 3 additions & 3 deletions examples/complete-vpn-gateway-with-static-routes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ Run `terraform destroy` when you don't need these resources.

| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.66 |
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.3 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.42 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 4.66 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.42 |

## Modules

Expand Down
4 changes: 2 additions & 2 deletions examples/complete-vpn-gateway-with-static-routes/versions.tf
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
terraform {
required_version = ">= 1.0"
required_version = ">= 1.3"

required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 4.66"
version = ">= 5.42"
}
}
}
6 changes: 3 additions & 3 deletions examples/complete-vpn-gateway/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ Run `terraform destroy` when you don't need these resources.

| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.66 |
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.3 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.42 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 4.66 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.42 |

## Modules

Expand Down
4 changes: 2 additions & 2 deletions examples/complete-vpn-gateway/versions.tf
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
terraform {
required_version = ">= 1.0"
required_version = ">= 1.3"

required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 4.66"
version = ">= 5.42"
}
}
}
6 changes: 3 additions & 3 deletions examples/minimal-vpn-gateway/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ Run `terraform destroy` when you don't need these resources.

| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.66 |
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.3 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.42 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 4.66 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.42 |

## Modules

Expand Down
4 changes: 2 additions & 2 deletions examples/minimal-vpn-gateway/versions.tf
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
terraform {
required_version = ">= 1.0"
required_version = ">= 1.3"

required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 4.66"
version = ">= 5.42"
}
}
}
12 changes: 8 additions & 4 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ resource "aws_vpn_connection" "default" {
customer_gateway_id = var.customer_gateway_id
type = "ipsec.1"

static_routes_only = var.vpn_connection_static_routes_only
static_routes_only = var.vpn_connection_static_routes_only
enable_acceleration = var.vpn_connection_enable_acceleration

tunnel1_phase1_dh_group_numbers = var.tunnel1_phase1_dh_group_numbers
tunnel2_phase1_dh_group_numbers = var.tunnel2_phase1_dh_group_numbers
Expand Down Expand Up @@ -132,7 +133,8 @@ resource "aws_vpn_connection" "tunnel" {
customer_gateway_id = var.customer_gateway_id
type = "ipsec.1"

static_routes_only = var.vpn_connection_static_routes_only
static_routes_only = var.vpn_connection_static_routes_only
enable_acceleration = var.vpn_connection_enable_acceleration

tunnel1_inside_cidr = var.tunnel1_inside_cidr
tunnel2_inside_cidr = var.tunnel2_inside_cidr
Expand Down Expand Up @@ -243,7 +245,8 @@ resource "aws_vpn_connection" "preshared" {
customer_gateway_id = var.customer_gateway_id
type = "ipsec.1"

static_routes_only = var.vpn_connection_static_routes_only
static_routes_only = var.vpn_connection_static_routes_only
enable_acceleration = var.vpn_connection_enable_acceleration

tunnel1_preshared_key = var.tunnel1_preshared_key
tunnel2_preshared_key = var.tunnel2_preshared_key
Expand Down Expand Up @@ -351,7 +354,8 @@ resource "aws_vpn_connection" "tunnel_preshared" {
customer_gateway_id = var.customer_gateway_id
type = "ipsec.1"

static_routes_only = var.vpn_connection_static_routes_only
static_routes_only = var.vpn_connection_static_routes_only
enable_acceleration = var.vpn_connection_enable_acceleration

tunnel1_inside_cidr = var.tunnel1_inside_cidr
tunnel2_inside_cidr = var.tunnel2_inside_cidr
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ variable "vpn_connection_static_routes_only" {
default = false
}

variable "vpn_connection_enable_acceleration" {
description = "Indicate whether to enable acceleration for the VPN connection. Supports only EC2 Transit Gateway."
type = bool
default = null
}

variable "vpn_connection_static_routes_destinations" {
description = "List of CIDRs to be used as destination for static routes (used with `vpn_connection_static_routes_only = true`). Routes to destinations set here will be propagated to the routing tables of the subnets defined in `vpc_subnet_route_table_ids`."
type = list(string)
Expand Down
4 changes: 2 additions & 2 deletions versions.tf
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
terraform {
required_version = ">= 1.0"
required_version = ">= 1.3"

required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 4.66"
version = ">= 5.42"
}
}
}

0 comments on commit 4f7c4d2

Please sign in to comment.