terraform-provider-hcloud
terraform-provider-hcloud copied to clipboard
Create loadbalancer with count.
╷
│ Error: Provider produced inconsistent result after apply
│
│ When applying changes to hcloud_load_balancer_target.load_balancer_target[0], provider "provider["registry.terraform.io/hetznercloud/hcloud"]" produced an
│ unexpected new value: Root resource was present, but now absent.
│
│ This is a bug in the provider, which should be reported in the provider's own issue tracker.
╵
╷
│ Error: Provider produced inconsistent result after apply
│
│ When applying changes to hcloud_load_balancer_target.load_balancer_target[1], provider "provider["registry.terraform.io/hetznercloud/hcloud"]" produced an
│ unexpected new value: Root resource was present, but now absent.
│
│ This is a bug in the provider, which should be reported in the provider's own issue tracker.
Here is all the files i wrote to repeat the error : https://github.com/spyrosamvra/terraform.git I delete my htoken so you only need to add yours in var.provider.tf
Hi @spyrosamvra,
thanks for reporting the bug. I created a PR to fix the issues: #596.
These issues showed up for you, because you used a datacenter.id
for the loadbalancer location. The correct argument would have been a location.name
. I created another PR to improve the docs for this: #595
You can make these changes to your files to fix it:
+data "hcloud_location" "location" {
+ name = "hel1"
+}
resource "hcloud_load_balancer" "loadbalancers" {
count = length(local.lb_names)
name = local.lb_names[count.index]
load_balancer_type = var.lb_type
- location = data.hcloud_datacenter.datacenter.id
+ location = data.hcloud_location.location.name
}
PR #596 is merged! Thanks again for reporting.