Skip to content

Commit

Permalink
feat: Add labels to VPN tunnel (#76)
Browse files Browse the repository at this point in the history
* Add labels

* new line at end

* terraform fmt
  • Loading branch information
lchastel authored Apr 11, 2022
1 parent 32930b3 commit c2e563b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions modules/vpn_ha/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ module "vpn_ha" {
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| create\_vpn\_gateway | create a VPN gateway | `bool` | `true` | no |
| labels | Labels for vpn components | `map(string)` | `{}` | no |
| name | VPN gateway name, and prefix used for dependent resources. | `string` | n/a | yes |
| network | VPC used for the gateway and routes. | `string` | n/a | yes |
| peer\_external\_gateway | Configuration of an external VPN gateway to which this VPN is connected. | <pre>object({<br> redundancy_type = string<br> interfaces = list(object({<br> id = number<br> ip_address = string<br> }))<br> })</pre> | `null` | no |
Expand Down
1 change: 1 addition & 0 deletions modules/vpn_ha/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ resource "google_compute_vpn_tunnel" "tunnels" {
ike_version = each.value.ike_version
shared_secret = each.value.shared_secret == "" ? local.secret : each.value.shared_secret
vpn_gateway = local.vpn_gateway_self_link
labels = var.labels
}

resource "random_id" "secret" {
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 @@ -112,3 +112,9 @@ variable "create_vpn_gateway" {
default = true
type = bool
}

variable "labels" {
description = "Labels for vpn components"
type = map(string)
default = {}
}

0 comments on commit c2e563b

Please sign in to comment.