Parametrized more hardcoded values.

This commit is contained in:
2025-03-31 16:13:34 +02:00
parent c878380f33
commit 9fa068ee96
3 changed files with 16 additions and 16 deletions
+3 -9
View File
@@ -71,7 +71,7 @@ module "gw" {
name = "${var.hub.name}-vpn" name = "${var.hub.name}-vpn"
network_name = module.hub_network.name network_name = module.hub_network.name
region = var.hub.region region = var.hub.region
vpn_external_ip = "vpw-gw-us-west1" vpn_external_ip = var.vpn_external_ip
} }
module "to_lazurowa" { module "to_lazurowa" {
@@ -81,14 +81,8 @@ module "to_lazurowa" {
peer_ip = var.peer_ip peer_ip = var.peer_ip
shared_secret = var.shared_secret shared_secret = var.shared_secret
local_selectors = [ local_selectors = [var.hub.cidr, var.spoke.cidr]
var.hub.cidr, remote_selectors = var.remote_selectors
var.spoke.cidr
]
remote_selectors = [
"192.168.2.0/24", "192.168.10.0/24"
]
depends_on = [module.gw] depends_on = [module.gw]
} }
+1 -1
View File
@@ -14,7 +14,7 @@ variable "region" {
} }
variable "vpn_external_ip" { variable "vpn_external_ip" {
description = "The name of the external IP address of the VPN Gateway." description = "External IP address for the VPN gateway. If not provided, a new IP will be allocated."
type = string type = string
nullable = true nullable = true
default = null default = null
+12 -6
View File
@@ -19,7 +19,6 @@ variable "spoke" {
} }
variable "ssh" { variable "ssh" {
description = "SSH Key(s) definition"
type = list(object({ type = list(object({
public_key = string public_key = string
ssh_user = string ssh_user = string
@@ -31,13 +30,20 @@ variable "ssh" {
}] }]
} }
variable "vpn_external_ip" {
type = string
nullable = true
}
variable "peer_ip" { variable "peer_ip" {
description = "IP address of the remote peer VPN gateway" type = string
type = string
} }
variable "shared_secret" { variable "shared_secret" {
description = "Shared secret for the VPN tunnel" type = string
type = string sensitive = true
sensitive = true }
variable "remote_selectors" {
type = list(string)
} }