Hello,
I would like to rename an optional attribute.
I look at this web page: Plugin Development - Deprecations, Removals, and Renames Best Practices | Terraform | HashiCorp Developer.
However I am facing an issue that I am not able to resolve.
Here is the definition block:
"ui_visibility": {
Type: schema.TypeString,
Optional: true,
Default: "always",
Deprecated: "Attribute ui_visibility is deprecated and will be removed in future version. Use ui_visible instead.",
ValidateFunc: validation.StringInSlice([]string{"always", "if-set", "hidden"}, false),
Description: "The filter logic for this custom field. Allowed values: \"always\" (default), \"if-set\", \"hidden\"",
},
"ui_visible": {
Type: schema.TypeString,
Optional: true,
Default: "always",
ValidateFunc: validation.StringInSlice([]string{"always", "if-set", "hidden"}, false),
Description: "The filter logic for this custom field. Allowed values: \"always\" (default), \"if-set\", \"hidden\"",
ConflictsWith: []string{"ui_visibility"},
},
My tests are done with the old attribute.
After applying a first time, when I apply a second time, I have this answer:
# netbox_extras_custom_field.test will be updated in-place
~ resource "netbox_extras_custom_field" "test" {
id = "273"
name = "test_hdgq8y636n"
~ ui_visible = "hidden" -> "always"
# (20 unchanged attributes hidden)
}
Where I need to change something ? In the read function ?
Thanks.