Closed trunet closed 1 month ago
@trunet It would be great if you could provide me with a minimal Terraform example code that led you to this problem.
Should be pretty straightforward. Just create the LB resource and not set a description.
In my case is part of a large module that handles a lot of stuff (netbox registration, ovn network, incus vm or container, image handling, load balancer, ...)
This is the excerpt from the lb resource:
resource "incus_network_lb" "this" {
count = var.ovn_network != null && var.lb_ip_address != null && length(var.lb_ports) > 0 ? 1 : 0
network = var.ovn_network
description = "${title(var.name)} ${var.region} LB"
listen_address = var.lb_ip_address
dynamic "backend" {
for_each = { for idx, instance in incus_instance.this : instance.name => instance }
content {
name = backend.value.name
description = "Backend for ${backend.value.name}"
target_address = backend.value.ipv4_address
target_port = var.lb_port != null ? var.lb_port : var.lb_ports[0]
}
}
dynamic "port" {
for_each = var.lb_ports
content {
description = "Port ${port.value}/tcp"
protocol = "tcp"
listen_port = port.value
target_backend = incus_instance.this.*.name
}
}
}
It creates the LB just fine, however, it keeps throwing errors every time.
If I set the description for every backend, it works. The provider should or set description as required, or allow the description to be null.