diff --git a/netbox/resource_netbox_ipam_ip_addresses.go b/netbox/resource_netbox_ipam_ip_addresses.go index 4936c7f00..28d48b761 100644 --- a/netbox/resource_netbox_ipam_ip_addresses.go +++ b/netbox/resource_netbox_ipam_ip_addresses.go @@ -31,6 +31,7 @@ func resourceNetboxIpamIPAddresses() *schema.Resource { "description": { Type: schema.TypeString, Optional: true, + Default: " ", ValidateFunc: validation.StringLenBetween(1, 100), }, "dns_name": { @@ -180,7 +181,14 @@ func resourceNetboxIpamIPAddressesRead(d *schema.ResourceData, return err } - if err = d.Set("description", resource.Description); err != nil { + var description string + if resource.Description == "" { + description = " " + } else { + description = resource.Description + } + + if err = d.Set("description", description); err != nil { return err } diff --git a/netbox/resource_netbox_ipam_prefix.go b/netbox/resource_netbox_ipam_prefix.go index 1a91529b2..9b5d5d337 100644 --- a/netbox/resource_netbox_ipam_prefix.go +++ b/netbox/resource_netbox_ipam_prefix.go @@ -23,6 +23,7 @@ func resourceNetboxIpamPrefix() *schema.Resource { "description": { Type: schema.TypeString, Optional: true, + Default: " ", ValidateFunc: validation.StringLenBetween(1, 100), }, "is_pool": { @@ -150,7 +151,15 @@ func resourceNetboxIpamPrefixRead(d *schema.ResourceData, for _, resource := range resources.Payload.Results { if strconv.FormatInt(resource.ID, 10) == d.Id() { - if err = d.Set("description", resource.Description); err != nil { + var description string + + if resource.Description == "" { + description = " " + } else { + description = resource.Description + } + + if err = d.Set("description", description); err != nil { return err } diff --git a/netbox/resource_netbox_ipam_vlan.go b/netbox/resource_netbox_ipam_vlan.go index 3e10361d6..28c581c51 100644 --- a/netbox/resource_netbox_ipam_vlan.go +++ b/netbox/resource_netbox_ipam_vlan.go @@ -23,6 +23,7 @@ func resourceNetboxIpamVlan() *schema.Resource { "description": { Type: schema.TypeString, Optional: true, + Default: " ", ValidateFunc: validation.StringLenBetween(1, 100), }, "vlan_group_id": { @@ -139,7 +140,15 @@ func resourceNetboxIpamVlanRead(d *schema.ResourceData, for _, resource := range resources.Payload.Results { if strconv.FormatInt(resource.ID, 10) == d.Id() { - if err = d.Set("description", resource.Description); err != nil { + var description string + + if resource.Description == "" { + description = " " + } else { + description = resource.Description + } + + if err = d.Set("description", description); err != nil { return err } diff --git a/netbox/resource_netbox_tenancy_tenant.go b/netbox/resource_netbox_tenancy_tenant.go index 8018982de..187e86b0a 100644 --- a/netbox/resource_netbox_tenancy_tenant.go +++ b/netbox/resource_netbox_tenancy_tenant.go @@ -29,6 +29,7 @@ func resourceNetboxTenancyTenant() *schema.Resource { "description": { Type: schema.TypeString, Optional: true, + Default: " ", ValidateFunc: validation.StringLenBetween(1, 100), }, "tenant_group_id": { @@ -128,7 +129,15 @@ func resourceNetboxTenancyTenantRead(d *schema.ResourceData, return err } - if err = d.Set("description", resource.Description); err != nil { + var description string + + if resource.Description == "" { + description = " " + } else { + description = resource.Description + } + + if err = d.Set("description", description); err != nil { return err }