diff --git a/docs/data-sources/tenancy_tenant_group.md b/docs/data-sources/tenancy_tenant_group.md index 14c9fcf8e..7a03b3ed5 100644 --- a/docs/data-sources/tenancy_tenant_group.md +++ b/docs/data-sources/tenancy_tenant_group.md @@ -5,7 +5,7 @@ Get info about tenancy tenant groups from netbox. ## Example Usage ```hcl -data "netbox_tenancy_tenant_groups" "tenant_group_test" { +data "netbox_tenancy_tenant_group" "tenant_group_test" { slug = "TestTenantGroup" } ``` diff --git a/docs/index.md b/docs/index.md index 2b539b0b8..7524fcef3 100644 --- a/docs/index.md +++ b/docs/index.md @@ -4,8 +4,11 @@ Terraform provider for [Netbox.](https://netbox.readthedocs.io/en/stable/) ## Compatibility with Netbox -Version 0.x.y => Netbox 2.8 -Version 1.x.y => Netbox 2.9 +| Netbox version | Provider version | +|:--------------:|:----------------:| +| 2.8 | 0.x.y | +| 2.9 | 1.x.y | +| 2.11 | 2.x.y | ## Example Usage diff --git a/docs/resources/ipam_ip_addresses.md b/docs/resources/ipam_ip_addresses.md index 08fc3f0d3..bf7284cd1 100644 --- a/docs/resources/ipam_ip_addresses.md +++ b/docs/resources/ipam_ip_addresses.md @@ -68,7 +68,7 @@ The following arguments are supported: * ``nat_inside_id`` - (Optional) The ID of the NAT inside of this object. * ``object_id`` - (Optional) The ID of the object where this resource is attached to. * ``object_type`` - (Optional) The object type among virtualization.vminterface -or dcim.interface (virtualization.vminterface by default) +or dcim.interface (empty by default) * ``primary_ip4`` - (Optional) Set this resource as primary IPv4 (false by default) * ``role`` - (Optional) The role among loopback, secondary, anycast, vip, vrrp, hsrp, glbp, carp of this object. * ``status`` - (Optional) The status among container, active, reserved, deprecated (active by default). diff --git a/netbox/resource_netbox_ipam_ip_addresses.go b/netbox/resource_netbox_ipam_ip_addresses.go index 8b3efcbb2..7e33e0797 100644 --- a/netbox/resource_netbox_ipam_ip_addresses.go +++ b/netbox/resource_netbox_ipam_ip_addresses.go @@ -77,7 +77,7 @@ func resourceNetboxIpamIPAddresses() *schema.Resource { "object_type": { Type: schema.TypeString, Optional: true, - Default: VMInterfaceType, + Default: "", ValidateFunc: validation.StringInSlice([]string{ VMInterfaceType, "dcim.interface"}, false), }, @@ -296,11 +296,16 @@ func resourceNetboxIpamIPAddressesRead(d *schema.ResourceData, } objectType := resource.AssignedObjectType - if *objectType == "" { + if objectType != nil { *objectType = VMInterfaceType - } - if err = d.Set("object_type", objectType); err != nil { - return err + + if err = d.Set("object_type", *objectType); err != nil { + return err + } + } else { + if err = d.Set("object_type", nil); err != nil { + return err + } } if resource.Role == nil {