Open wuetz opened 1 year ago
I beleive I found a way around this issue. The type for custom_fields has been set to TypeMap
this is forcing all the attributes under it to be a string type. Since custom fields can be all sorts of types, we need to keep it as TypeString
and us a Json Marshal to convert it to a json type.
Then we can use something like this to access the fields.
data "netbox_virtual_machines" "test" {
name_regex = "test"
}
output "test-dbs" {
value = jsondecode(data.netbox_virtual_machines.test.vms[0].custom_fields).deployed
}
@fbreckle - if you agree with this approach, I can get something started.
+1 on this
Error: devices.0.custom_fields.redfish_run: '' expected type 'string', got unconvertible type 'bool', value: 'true'
Issue Reporting Guide
Terraform Version
Affected DataSource(s)
Terraform Configuration Files
Output
Debug Output
Expected Behavior
Read the device data
Actual Behavior
Steps to Reproduce
Create a device with a custom field of type boolean. Then run the above TF config which tries to read the device from netbox
Additional Information
If i do a GET request on this device on the netbox API itself, I do get a valid response, where custom fields look like: