diff --git a/config.auto.tfvars.tpl b/config.auto.tfvars.tpl index 425891f..e931597 100644 --- a/config.auto.tfvars.tpl +++ b/config.auto.tfvars.tpl @@ -3,7 +3,7 @@ hetzner_cloud_apitoken = "YOUR_HETZNER_CLOUD_API_TOKEN" # Hetzner-locations: https://docs.hetzner.com/cloud/general/locations/ k8s_servers = [ - { type = "cax11", location = "fsn1", ip_datacenter = "fsn1-dc14" } + { type = "cax11", location = "fsn1" } ] k8s_agents = [ { type = "cax11", location = "fsn1" } diff --git a/modules/hetzner/kubernetes/main.tf b/modules/hetzner/kubernetes/main.tf index 1e3d242..6503fcb 100644 --- a/modules/hetzner/kubernetes/main.tf +++ b/modules/hetzner/kubernetes/main.tf @@ -2,7 +2,7 @@ resource "hcloud_primary_ip" "ipv4" { count = length(var.servers) name = "k8s_primary_ipv4_${count.index}" - datacenter = var.servers[count.index].ip_datacenter + location = var.servers[count.index].location type = "ipv4" assignee_type = "server" auto_delete = var.auto_delete_primary_ips @@ -12,7 +12,7 @@ resource "hcloud_primary_ip" "ipv6" { count = length(var.servers) name = "k8s_primary_ipv6_${count.index}" - datacenter = var.servers[count.index].ip_datacenter + location = var.servers[count.index].location type = "ipv6" assignee_type = "server" auto_delete = var.auto_delete_primary_ips diff --git a/modules/hetzner/kubernetes/variables.tf b/modules/hetzner/kubernetes/variables.tf index d45275b..407f5ec 100644 --- a/modules/hetzner/kubernetes/variables.tf +++ b/modules/hetzner/kubernetes/variables.tf @@ -8,9 +8,8 @@ variable "ssh_keys" { variable "servers" { type = list(object({ - type = string - location = string - ip_datacenter = string + type = string + location = string })) } diff --git a/variables.tf b/variables.tf index 68520af..7dd9f2d 100644 --- a/variables.tf +++ b/variables.tf @@ -34,15 +34,13 @@ variable "ssh_keys" { variable "k8s_servers" { type = list(object({ - type = optional(string, "cax11") - location = string - ip_datacenter = string + type = optional(string, "cax11") + location = string })) description = <