You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've run into an issue where the data type returned for a custom field in the netbox_virtual_machines data source does not match the expected type when the custom field is configured as Multiple selection, per below. All works when there is a custom field defined of type Text or no custom field defined, so it's definitely because of the Multiple selection type.
❯ tofu plan
data.netbox_cluster.query: Reading...
data.netbox_cluster.query: Read complete after 1s [id=2]
data.netbox_virtual_machines.list: Reading...
Planning failed. OpenTofu encountered an error while generating this plan.
╷
│ Error: vms.0.custom_fields.ansible_roles: '' expected type'string', got unconvertible type'[]interface {}', value: '[base]'
│
│ with data.netbox_virtual_machines.list,
│ on main.tf line 24, in data "netbox_virtual_machines""list":
│ 24: data "netbox_virtual_machines""list" {
│
╵
Expected Behavior
Map of VM's returned.
Actual Behavior
Type failure because of the custom field definition in Netbox.
Steps to Reproduce
In Netbox, configure a VM custom field with the type Multiple selection
Add the netbox_virtual_machines data source to your TF config
terraform/tofu plan
The text was updated successfully, but these errors were encountered:
I've run into an issue where the data type returned for a custom field in the netbox_virtual_machines data source does not match the expected type when the custom field is configured as
Multiple selection
, per below. All works when there is a custom field defined of typeText
or no custom field defined, so it's definitely because of theMultiple selection
type.Terraform Version
Netbox Version
v4.0.8
Affected Resource(s)
Terraform Configuration Files
Debug Output
Expected Behavior
Map of VM's returned.
Actual Behavior
Type failure because of the custom field definition in Netbox.
Steps to Reproduce
Multiple selection
netbox_virtual_machines
data source to your TF configterraform/tofu plan
The text was updated successfully, but these errors were encountered: