Closed ad8lmondy closed 1 month ago
As per the tests, and my own usage - when resources do not have a custom_field
set, terraform wants to remove the item:
Terraform will perform the following actions:
# netbox_prefix.test will be updated in-place
~ resource "netbox_prefix" "test" {
~ custom_fields = {
- "test" = null
}
id = "19"
# (10 unchanged attributes hidden)
}
Plan: 0 to add, 1 to change, 0 to destroy.
However, this always happens. If I set the resource to have:
custom_fields = {
test = null
}
Terraform treats the test
field as omitted, and so it can never seem to be satisfied.
Not really sure how to get around this issue :(
This is a poor substitute for the work started here: https://github.com/e-breuninger/terraform-provider-netbox/pull/242
go-netbox has these additional values defined: https://github.com/fbreckle/go-netbox/blob/2513e68359ff2e42cfc1deed72034bd8ff1dee8e/netbox/models/custom_field.go#L989-L999
But the provider rejects them as invalid.
Tested OK on my personal netbox.