Hello,
I have this piece of HCL code:
resource "netbox_tenant" "tenant_test" {
...
custom_field {
name = "TestBoolean"
kind = "bool"
value = "false"
}
custom_field {
name = "TestInteger"
kind = "int"
value = "10"
}
}
The definition in the provider is like this:
"custom_field": {
Type: schema.TypeSet,
Optional: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"name": {
Type: schema.TypeString,
Required: true,
},
"kind": {
Type: schema.TypeString,
Required: true,
ForceNew: true,
ValidateFunc: validation.StringInSlice([]string{"string",
"bool", "int"}, false),
},
"value": {
Type: schema.TypeString,
Required: true,
},
},
},
},
In the read function I have d.Set(“custom_fields”, convertApiToCF(tenant.CustomFields)).
convertApiToCF is returning a type [ ]map[string]string, is-it correct ?
Terraform is not detecting changes …
Thanks.