fix: use subnet_id for hcloud server network resource
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Robert Kaussow 2022-10-14 21:26:58 +02:00
parent 96ca43bf01
commit 197c2359c1
Signed by: xoxys
GPG Key ID: 4E692A2EAECC03C0

10
main.tf
View File

@ -74,12 +74,12 @@ resource "hcloud_ssh_key" "key" {
public_key = "${element(split(" ", each.value), 0)} ${element(split(" ", each.value), 1)}" public_key = "${element(split(" ", each.value), 0)} ${element(split(" ", each.value), 1)}"
} }
resource "hcloud_server_network" "network" { resource "hcloud_server_network" "subnets" {
for_each = { for row in var.server : row.name => row if contains(keys(row), "network") } for_each = { for row in var.server : row.name => row if contains(keys(row), "subnet") }
server_id = hcloud_server.server[each.value.name].id server_id = hcloud_server.server[each.value.name].id
network_id = each.value.network subnet_id = each.value.subnet
ip = each.value.network_ip ip = each.value.subnet_ip
} }
resource "hcloud_rdns" "serverv4" { resource "hcloud_rdns" "serverv4" {