generated from hashicorp/terraform-provider-scaffolding
-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: allow any custom field type in netbox_device
Updates the `netbox_device` resource to allow for any custom field type to be set. This is done by using a string field with the `jsonencode()` and `jsondecode()` terraform functions. This allows for any complex custom fields or data types that are needed, since the underlying types don't matter and are unmarshalled using map[string]interface{}. To set custom fields using this new method, use the following syntax. ```terraform resource "netbox_device" "test" { name = "device1" tenant_id = netbox_tenant.test.id role_id = netbox_device_role.test.id device_type_id = netbox_device_type.test.id site_id = netbox_site.test.id custom_fields = jsonencode({ "text_field" = "81" "bool_field" = true }) } ``` NOTE: This may be a breaking change for some users.
- Loading branch information
Showing
3 changed files
with
86 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters