After upgrading the provider from 0.43.1 to 0.46.1, a plan on our ovh_cloud_project_kube resource resulted in the following error:
│ Error: Missing required argument
│
│ with ovh_cloud_project_kube.main,
│ on ovh-cluster.tf line 6, in resource "ovh_cloud_project_kube" "main":
│ 6: private_network_id = tolist(ovh_cloud_project_network_private.net.regions_attributes[*].openstackid)[0]
│
│ "private_network_id": all of `load_balancers_subnet_id,private_network_id` must be specified
The used configuration looked like this:
resource "ovh_cloud_project_kube" "main" {
service_name = local.service_name
name = "${var.stage}-k8s"
region = local.stage_config[var.stage].location
version = local.stage_config[var.stage].version
private_network_id = tolist(ovh_cloud_project_network_private.net.regions_attributes[*].openstackid)[0]
depends_on = [
ovh_cloud_project_network_private.net
]
}
I modified the resource, to include the load_balancers_subnet_id as follows:
resource "ovh_cloud_project_kube" "main" {
service_name = local.service_name
name = "${var.stage}-k8s"
region = local.stage_config[var.stage].location
version = local.stage_config[var.stage].version
load_balancers_subnet_id = ovh_cloud_project_network_private_subnet.subnet.id
private_network_id = tolist(ovh_cloud_project_network_private.net.regions_attributes[*].openstackid)[0]
depends_on = [
ovh_cloud_project_network_private.net
]
}
Then running plan and apply successfully finishes. But when running a plan afterwards, the resource wants to update again:
OpenTofu will perform the following actions:
# ovh_cloud_project_kube.main will be updated in-place
~ resource "ovh_cloud_project_kube" "main" {
id = "f1b8dd51-f77c-4c48-8c34-15ee13fc576a"
+ load_balancers_subnet_id = "9045d2ab-f5b5-4792-9771-fa8c1f12ed99"
name = "dev-k8s"
# (15 unchanged attributes hidden)
# (1 unchanged block hidden)
}
Here I'd expect no changes to be planned.
First of all, from the documentation it's unclear to me, that load_balancers_subnet_id is required, when private_network_id is set, the last example in the documentation even uses the private_network_id without the load_balancers_subnet_id. It's also slightly unclear to me, which effect the load_balancers_subnet_id will have, though I assume it's not about the external IP of the loadbalancer. Though then I'd assume the nodes_subnet_id should be used here?
Secondly, applying the change to load_balancers_subnet_id doesn't actually seem to have an effect.
Terraform Version
OpenTofu v1.7.0-alpha1
OVH Terraform Provider Version
v0.46.1
Affected Resource(s)
ovh_cloud_project_kube
Terraform Configuration Files
relevant part is:
resource "ovh_cloud_project_kube" "main" {
service_name = local.service_name
name = "${var.stage}-k8s"
region = local.stage_config[var.stage].location
version = local.stage_config[var.stage].version
load_balancers_subnet_id = ovh_cloud_project_network_private_subnet.subnet.id
private_network_id = tolist(ovh_cloud_project_network_private.net.regions_attributes[*].openstackid)[0]
depends_on = [
ovh_cloud_project_network_private.net
]
}
Expected Behavior
I'm unsure if load_balancers_subnet_id should actually be required when using private_network_id. Documentation should reflect this requirement.
The resource should be actually updated when setting load_balancers_subnet_id and not produce planned changes on every run.
Actual Behavior
Regarding 1 using private_network_id without load_balancers_subnet_id produces an error.
Regarding 2, the resource is unchanged after applying.
Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
terraform plan -out planfile on the first configuration. Error should appear
add load_balancers_subnet_id to configuration
terraform plan -out planfile should work without errors
terraform apply planfile should run succesfully
terraform plan -out planfile will plan the change on the resource again
Describe the bug
After upgrading the provider from 0.43.1 to 0.46.1, a plan on our
ovh_cloud_project_kube
resource resulted in the following error:The used configuration looked like this:
I modified the resource, to include the
load_balancers_subnet_id
as follows:Then running
plan
andapply
successfully finishes. But when running a plan afterwards, the resource wants to update again:Here I'd expect no changes to be planned.
First of all, from the documentation it's unclear to me, that
load_balancers_subnet_id
is required, whenprivate_network_id
is set, the last example in the documentation even uses theprivate_network_id
without theload_balancers_subnet_id
. It's also slightly unclear to me, which effect theload_balancers_subnet_id
will have, though I assume it's not about the external IP of the loadbalancer. Though then I'd assume thenodes_subnet_id
should be used here?Secondly, applying the change to
load_balancers_subnet_id
doesn't actually seem to have an effect.Terraform Version
OpenTofu v1.7.0-alpha1
OVH Terraform Provider Version
v0.46.1
Affected Resource(s)
Terraform Configuration Files
relevant part is:
Expected Behavior
load_balancers_subnet_id
should actually be required when usingprivate_network_id
. Documentation should reflect this requirement.load_balancers_subnet_id
and not produce planned changes on every run.Actual Behavior
Regarding 1 using
private_network_id
withoutload_balancers_subnet_id
produces an error. Regarding 2, the resource is unchanged after applying.Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
terraform plan -out planfile
on the first configuration. Error should appearload_balancers_subnet_id
to configurationterraform plan -out planfile
should work without errorsterraform apply planfile
should run succesfullyterraform plan -out planfile
will plan the change on the resource again