Skip to content

Commit

Permalink
feat: Update provider to work with Netbox 2.9
Browse files Browse the repository at this point in the history
  • Loading branch information
smutel committed Oct 17, 2020
1 parent 461299a commit 8d5633e
Show file tree
Hide file tree
Showing 766 changed files with 38,189 additions and 9,177 deletions.
11 changes: 8 additions & 3 deletions docs/resources/ipam_ip_addresses.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@ Manages an ipam ip addresses resource within Netbox.
resource "netbox_ipam_ip_addresses" "ip_test" {
address = "192.168.56.0/24"
description = "IP created by terraform"
tags = ["tag1"]
status = "active"
tag {
name = "tag1"
slug = "tag1"
}
}
```

Expand All @@ -24,12 +28,13 @@ The following arguments are supported:
* ``nat_outside_id`` - (Optional) The ID of the NAT outside of this object.
* ``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).
* ``tags`` - (Optional) Array of tags for this object.
* ``tenant_id`` - (Optional) ID of the tenant where this object is attached.
* ``vrf_id`` - (Optional) The ID of the vrf attached to this object.
The ``tag`` block supports:
* ``name`` - (Required) Name of the existing tag to associate with this resource.
* ``slug`` - (Required) Slug of the existing tag to associate with this resource.

## Attributes Reference

In addition to the above arguments, the following attributes are exported:
* ``id`` - The id (ref in Netbox) of this object.

10 changes: 8 additions & 2 deletions docs/resources/ipam_prefix.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@ resource "netbox_ipam_prefix" "prefix_test" {
description = "Prefix created by terraform"
site_id = netbox_ipam_vlan_group.vlan_group_test.site_id
role_id = data.netbox_ipam_roles.vlan_role_production.id
tags = ["tag1"]
status = "active"
tag {
name = "tag1"
slug = "tag1"
}
}
```

Expand All @@ -25,10 +29,12 @@ The following arguments are supported:
* ``role_id`` - (Optional) The ID of the role attached to this object.
* ``site_id`` - (Optional) ID of the site where this object is created
* ``status`` - (Optional) The status among container, active, reserved, deprecated (active by default).
* ``tags`` - (Optional) Array of tags for this object.
* ``tenant_id`` - (Optional) ID of the tenant where this object is attached.
* ``vlan_id`` - (Optional) ID of the vlan where this object is attached.
* ``vrf_id`` - (Optional) The ID of the vrf attached to this object.
The ``tag`` block supports:
* ``name`` - (Required) Name of the existing tag to associate with this resource.
* ``slug`` - (Required) Slug of the existing tag to associate with this resource.

## Attributes Reference

Expand Down
10 changes: 8 additions & 2 deletions docs/resources/ipam_vlan.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ resource "netbox_ipam_vlan" "vlan_test" {
vlan_group_id = netbox_ipam_vlan_group.vlan_group_test.id
tenant_id = netbox_tenancy_tenant.tenant_test.id
role_id = data.netbox_ipam_roles.vlan_role_production.id
tags = ["tag1"]
tag {
name = "tag1"
slug = "tag1"
}
}
```

Expand All @@ -26,9 +30,11 @@ The following arguments are supported:
* ``role_id`` - (Optional) The ID of the role attached to this object.
* ``site_id`` - (Optional) ID of the site where this object is created.
* ``status`` - (Optional) The status among container, active, reserved, deprecated (active by default).
* ``tags`` - (Optional) Array of tags for this vlan.
* ``tenant_id`` - (Optional) ID of the tenant where this object is attached.
* ``vlan_id`` - (Required) The ID of this vlan (vlan tag).
The ``tag`` block supports:
* ``name`` - (Required) Name of the existing tag to associate with this resource.
* ``slug`` - (Required) Slug of the existing tag to associate with this resource.

## Attributes Reference

Expand Down
10 changes: 8 additions & 2 deletions docs/resources/tenancy_tenant.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ resource "netbox_tenancy_tenant" "tenant_test" {
description = "Tenant created by terraform"
comments = "Some test comments"
tenant_group_id = netbox_tenancy_tenant_group.tenant_group_test.id
tags = ["tag1"]
tag {
name = "tag1"
slug = "tag1"
}
}
```

Expand All @@ -23,7 +27,9 @@ The following arguments are supported:
* ``tenant_group_id`` - (Optional) ID of the group where this object is located.
* ``name`` - (Required) The name for this object.
* ``slug`` - (Required) The slug for this object.
* ``tags`` - (Optional) Array of tags for this tenant.
The ``tag`` block supports:
* ``name`` - (Required) Name of the existing tag to associate with this resource.
* ``slug`` - (Required) Slug of the existing tag to associate with this resource.

## Attributes Reference

Expand Down
44 changes: 40 additions & 4 deletions examples/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,16 @@ resource "netbox_tenancy_tenant" "tenant_test" {
description = "Tenant created by terraform"
comments = "Some test comments"
tenant_group_id = netbox_tenancy_tenant_group.tenant_group_test.id
tags = ["tag1", "tag3"]

tag {
name = "tag1"
slug = "tag1"
}

tag {
name = "tag2"
slug = "tag2"
}
}

resource "netbox_tenancy_tenant_group" "tenant_group_test" {
Expand Down Expand Up @@ -38,7 +47,16 @@ resource "netbox_ipam_vlan" "vlan_test" {
vlan_group_id = netbox_ipam_vlan_group.vlan_group_test.id
tenant_id = netbox_tenancy_tenant.tenant_test.id
role_id = data.netbox_ipam_role.vlan_role_production.id
tags = ["tag1"]

tag {
name = "tag1"
slug = "tag1"
}

tag {
name = "tag2"
slug = "tag2"
}
}

resource "netbox_ipam_prefix" "prefix_test" {
Expand All @@ -47,12 +65,30 @@ resource "netbox_ipam_prefix" "prefix_test" {
description = "Prefix created by terraform"
site_id = netbox_ipam_vlan_group.vlan_group_test.site_id
role_id = data.netbox_ipam_role.vlan_role_production.id
tags = ["tag1"]
status = "container"

tag {
name = "tag1"
slug = "tag1"
}

tag {
name = "tag2"
slug = "tag2"
}
}

resource "netbox_ipam_ip_addresses" "ip_test" {
address = "192.168.56.1/24"
status = "active"
tenant_id = netbox_tenancy_tenant.tenant_test.id

tag {
name = "tag1"
slug = "tag1"
}

tag {
name = "tag2"
slug = "tag2"
}
}
9 changes: 9 additions & 0 deletions examples/provider.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
terraform {
required_providers {
netbox = {
source = "registry.terraform.io/smutel/netbox"
version = "0.0.1"
}
}
}

4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ module github.com/smutel/terraform-provider-netbox
go 1.14

require (
github.com/go-openapi/runtime v0.19.15
github.com/go-openapi/runtime v0.19.21
github.com/go-openapi/strfmt v0.19.5
github.com/hashicorp/terraform-plugin-sdk v1.13.0
github.com/netbox-community/go-netbox v0.0.0-20200527232624-eea85738db88
github.com/netbox-community/go-netbox v0.0.0-20200916111521-9dc1ea8ff598
github.com/pkg/errors v0.9.1
)
Loading

0 comments on commit 8d5633e

Please sign in to comment.