From 97084c158140b718aa450fbc7143f864fac8dc5f Mon Sep 17 00:00:00 2001 From: MichaelFisher1997 Date: Sun, 1 Mar 2026 13:36:57 +0000 Subject: [PATCH] fix: make private IP outputs resilient during partial imports --- terraform/outputs.tf | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/terraform/outputs.tf b/terraform/outputs.tf index 9b10653..4a96d28 100644 --- a/terraform/outputs.tf +++ b/terraform/outputs.tf @@ -10,7 +10,10 @@ output "control_plane_names" { output "control_plane_private_ips" { description = "Private IPs of control plane nodes" - value = [for cp in hcloud_server.control_plane : one(cp.network).ip] + value = [ + for idx, cp in hcloud_server.control_plane : + try(one(cp.network).ip, cidrhost(var.subnet_cidr, 10 + idx)) + ] } output "primary_control_plane_ip" { @@ -30,7 +33,10 @@ output "worker_names" { output "worker_private_ips" { description = "Private IPs of worker nodes" - value = [for worker in hcloud_server.workers : one(worker.network).ip] + value = [ + for idx, worker in hcloud_server.workers : + try(one(worker.network).ip, cidrhost(var.subnet_cidr, 20 + idx)) + ] } output "ssh_private_key_path" {