Currently trying to get the new Hetzner Load Balancer working with multiple servers using Terraform v0.12.28. Provided documentation shows only case of one sever which is quite weird for a load balancer :)
Servers are created using count like this:
resource "hcloud_server" "web" {
count = var.instances
name = "web-server-${count.index}"
...
}
and to add a server to the load balancer one should use the pattern like this:
target {
type = "server"
server_id = hcloud_server.web.id
}
Yet any kind of for or for_each seems not applicable here to add all created instances.
Could you please show me the direction how to add count-created servers to the load balancer?
Thanks!