Open maxime1907 opened 2 days ago
Hello @maxime1907, thanks for opening this issue.
I took your exact configuration and I'm not able to reproduce the issue (ovh_subsidiary
is fetched from the same API call when reading a vrack
resource and when using datasource ovh_me
, so it should not be different when importing the resource).
What are the values that you have before and after for ovh_subsidiary
? And additionally that would help us debug if you could provide us the debug log of the import using TF_LOG=debug terraform import ...
.
Hello, thanks for your answer
Here is the debug output log of this command:
TF_LOG=debug terraform import 'module.ovh_managed_kubernetes.ovh_vrack.vrack' 'pn-REDACTED' > /tmp/output.log 2>&1
Here is the output of terraform plan after the import:
# module.ovh_managed_kubernetes.ovh_vrack.vrack must be replaced
-/+ resource "ovh_vrack" "vrack" {
~ id = "pn-REDACTED" -> (known after apply)
name = "REDACTED"
~ ovh_subsidiary = "FR" -> (known after apply) # forces replacement
~ service_name = "pn-REDACTED" -> (known after apply)
~ urn = "urn:v1:eu:resource:vrack:pn-REDACTED" -> (known after apply)
# (1 unchanged attribute hidden)
~ order (known after apply)
~ plan {
~ duration = "P1M" -> (known after apply)
~ pricing_mode = "default" -> (known after apply)
# (2 unchanged attributes hidden)
}
}
Describe the bug
We are trying to import an existing vrack into terraform. We have the correct vrack id and the import is successful, however, when running terraform plan it shows that we have to replace the vrack and everything inside it because the plan and ovh_subsidiary objects are added. I assume this is not intended behaviour.
Terraform Version
v1.9.6
OVH Terraform Provider Version
v0.50.0
Affected Resource(s)
Please list the resources as a list, for example:
Terraform Configuration Files
Expected Behavior
VRack is imported and next terraform plan only updates its fields.
Actual Behavior
After importing the resource it is forced to be replaced.
Steps to Reproduce
terraform import 'module.ovh_managed_kubernetes.ovh_vrack.vrack' 'pn-XXXXXX'
terraform plan -out=terraform.plan
Temporary workaround
References
Are there any other GitHub issues (open or closed) or Pull Requests that should be linked here? For example: