diff --git a/netbox/resource_netbox_custom_field.go b/netbox/resource_netbox_custom_field.go index 0e9ae0ef..a3507e64 100644 --- a/netbox/resource_netbox_custom_field.go +++ b/netbox/resource_netbox_custom_field.go @@ -108,6 +108,7 @@ func resourceNetboxCustomFieldUpdate(d *schema.ResourceData, m interface{}) erro data := &models.WritableCustomField{ Name: strToPtr(d.Get("name").(string)), Type: d.Get("type").(string), + Default: d.Get("default").(string), Description: d.Get("description").(string), GroupName: d.Get("group_name").(string), Label: d.Get("label").(string), @@ -157,6 +158,7 @@ func resourceNetboxCustomFieldCreate(d *schema.ResourceData, m interface{}) erro data := &models.WritableCustomField{ Name: strToPtr(d.Get("name").(string)), Type: d.Get("type").(string), + Default: d.Get("default").(string), Description: d.Get("description").(string), GroupName: d.Get("group_name").(string), Label: d.Get("label").(string), diff --git a/netbox/resource_netbox_custom_field_test.go b/netbox/resource_netbox_custom_field_test.go index e71c2d3c..3ea498c5 100644 --- a/netbox/resource_netbox_custom_field_test.go +++ b/netbox/resource_netbox_custom_field_test.go @@ -22,6 +22,7 @@ resource "netbox_custom_field" "test" { type = "text" content_types = ["virtualization.vminterface"] weight = 100 + default = "red" validation_regex = "^.*$" }`, testName), Check: resource.ComposeTestCheckFunc( @@ -29,6 +30,7 @@ resource "netbox_custom_field" "test" { resource.TestCheckResourceAttr("netbox_custom_field.test", "type", "text"), resource.TestCheckTypeSetElemAttr("netbox_custom_field.test", "content_types.*", "virtualization.vminterface"), resource.TestCheckResourceAttr("netbox_custom_field.test", "weight", "100"), + resource.TestCheckResourceAttr("netbox_custom_field.test", "default", "red"), resource.TestCheckResourceAttr("netbox_custom_field.test", "validation_regex", "^.*$"), ), },