Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions modules/vpn_ha/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ module "vpn_ha" {
|------|-------------|------|---------|:--------:|
| create\_vpn\_gateway | create a VPN gateway | `bool` | `true` | no |
| external\_vpn\_gateway\_description | An optional description of external VPN Gateway | `string` | `"Terraform managed external VPN gateway"` | no |
| interconnect\_attachment | URL of the interconnect attachment resource. When the value of this field is present, the VPN Gateway will be used for IPsec-encrypted Cloud Interconnect. | `list(string)` | `[]` | no |
| ipsec\_secret\_length | The lnegth the of shared secret for VPN tunnels | `number` | `8` | no |
| keepalive\_interval | The interval in seconds between BGP keepalive messages that are sent to the peer. | `number` | `20` | no |
| labels | Labels for vpn components | `map(string)` | `{}` | no |
Expand Down
7 changes: 7 additions & 0 deletions modules/vpn_ha/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ resource "google_compute_ha_vpn_gateway" "ha_gateway" {
network = var.network
stack_type = var.stack_type
labels = var.labels
dynamic "vpn_interfaces" {
for_each = { for idx, val in var.interconnect_attachment : idx => val }
content {
id = vpn_interfaces.key
interconnect_attachment = vpn_interfaces.value
}
}
}

resource "google_compute_external_vpn_gateway" "external_gateway" {
Expand Down
6 changes: 6 additions & 0 deletions modules/vpn_ha/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ variable "stack_type" {
default = "IPV4_ONLY"
}

variable "interconnect_attachment" {
description = "URL of the interconnect attachment resource. When the value of this field is present, the VPN Gateway will be used for IPsec-encrypted Cloud Interconnect."
type = list(string)
default = []
}

variable "network" {
description = "VPC used for the gateway and routes."
type = string
Expand Down