From 197c2359c13ba625a8d439e46e6cf889e6ad5e8d Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Fri, 14 Oct 2022 21:26:58 +0200 Subject: [PATCH] fix: use subnet_id for hcloud server network resource --- main.tf | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/main.tf b/main.tf index 81c5171..d064622 100644 --- a/main.tf +++ b/main.tf @@ -74,12 +74,12 @@ resource "hcloud_ssh_key" "key" { public_key = "${element(split(" ", each.value), 0)} ${element(split(" ", each.value), 1)}" } -resource "hcloud_server_network" "network" { - for_each = { for row in var.server : row.name => row if contains(keys(row), "network") } +resource "hcloud_server_network" "subnets" { + for_each = { for row in var.server : row.name => row if contains(keys(row), "subnet") } - server_id = hcloud_server.server[each.value.name].id - network_id = each.value.network - ip = each.value.network_ip + server_id = hcloud_server.server[each.value.name].id + subnet_id = each.value.subnet + ip = each.value.subnet_ip } resource "hcloud_rdns" "serverv4" {