diff --git a/main.tf b/main.tf index 32c4433..7b43530 100644 --- a/main.tf +++ b/main.tf @@ -23,10 +23,10 @@ resource "scaleway_instance_server" "this" { enable_ipv6 = var.routed_ip_enabled ? null : var.enable_ipv6 routed_ip_enabled = var.routed_ip_enabled - ip_ids = tolist([ + ip_ids = compact(tolist([ var.enable_public_ipv4 ? scaleway_instance_ip.public_ipv4[0].id : null, var.enable_ipv6 && var.routed_ip_enabled ? scaleway_instance_ip.ipv6[0].id : null, - ]) + ])) dynamic "private_network" { for_each = toset(var.private_networks)