e-breuninger /terraform-provider-netbox
Terraform provider to interact with Netbox
★ 301⑂ 211👁 14⑃ 765● 298▤ 130
+0
Daily
301
stars
211
forks
14
watchers
765
prs
298
issues
130
releases
README
terraform-provider-netbox
The Terraform Netbox provider is a plugin for Terraform that allows for the full lifecycle management of Netbox resources.
This provider is maintained by E. Breuninger.
See: Official documentation in the Terraform registry.
Requirements
- Terraform = 1.0
Supported netbox versions
Netbox often makes breaking API changes even in non-major releases. Check the table below to see which version a provider was tested against. It is generally recommended to use the provider version matching your Netbox version. We aim to always support the latest minor version of Netbox.
Since version 1.6.6, each version of the provider has a built-in list of all Netbox versions it supports at release time. Upon initialization, the provider will probe your Netbox version and include a (non-blocking) warning if the used Netbox version is not supported.
| Netbox version | Provider version |
| --------------- | ---------------- |
| v4.6.8 - 4.6.10 | v6.0.0 and up |
| v4.3.0 - 4.6.5 | v5.6.1 and up |
| v4.3.0 - 4.4.10 | v5.0.0 - 5.6.0 |
| v4.2.2 - 4.2.9 | v4.0.0 - 4.3.1 |
| v4.1.0 - 4.1.11 | v3.10.0 - 3.11.1 |
| v4.0.0 - 4.0.11 | v3.9.0 - 3.9.2 |
| v3.7.0 - 3.7.8 | v3.8.0 - 3.8.9 |
| v3.6.0 - 3.6.9 | v3.7.0 - 3.7.7 |
| v3.5.1 - 3.5.9 | v3.6.x |
| v3.4.3 - 3.4.10 | v3.5.x |
| v3.3.0 - 3.4.2 | v3.0.x - 3.5.1 |
| v3.2.0 - 3.2.9 | v2.0.x |
| v3.1.9 | v1.6.0 - 1.6.7 |
| v3.1.3 | v1.1.x - 1.5.2 |
| v3.0.9 | v1.0.x |
| v2.11.12 | v0.3.x |
| v2.10.10 | v0.2.x |
| v2.9 | v0.1.x |
Building The Provider
1. Clone the repository
1. Enter the repository directory
1. Build the provider using the Go install command:
sh
go install
Installation
Starting with Terraform 0.13, you can download the provider via the Terraform registry.
For further information on how to use third party providers, see the Terraform documentation
Releases for all major plattforms are available on the release page.
Using the provider
Here is a short example on how to use this provider:
hcl
provider "netbox" {
server_url = "https://demo.netbox.dev"
api_token = ""
}
resource "netbox_platform" "testplatform" {
name = "my-test-platform"
}
For a more examples, see the provider documentation.
Developing the Provider
If you wish to work on the provider, you need Go installed on your machine.
To compile the provider, run go install. This will build the provider and put the provider binary in the $GOPATH/bin directory.
To generate or update documentation, run make docs.
In order to run the suite of unit tests, run make test.
In order to run the full suite of acceptance tests, run make testacc.
In order to run a single specific acceptance test, run
sh
TEST_FUNC= make testacc-specific-test
For example:
sh
TEST_FUNC=TestAccNetboxLocationDataSource_basic make testacc-specific-test
_Note:_ Acceptance tests creTop issues
#263 (*interface {}) is not supported by the TextConsumer, can be resolved by supporting TextUnmarshaler interface12 comments · 2022-10-09#712`netbox_prefix` custom fields result in permanent state drift10 comments · 2025-04-14#709Its possible to get the last prefix available?6 comments · 2025-04-03#625U height for device type not set to 0, defaults in 16 comments · 2024-08-08#538New resource request: netbox_device_oob_ip 6 comments · 2024-01-16#371Feature Request: Add More "netbox_available_xxxx" Resources6 comments · 2023-04-02#748netbox_virtual_machine custom fields always wrong type5 comments · 2025-08-12#746"Client.Timeout exceeded while awaiting headers" and EOF errors when running behind Azure Firewall5 comments · 2025-08-07
Latest release
v6.0.1 v6.0.1 2026-11-136.0.1 (November 13th, 2026) ENHANCEMENTS This version adds lots of missing filters to the data sources. In particular, this includes filters for things that the filtered-for object does not directly have as an attribute. (e.g. you can now filter for site in cables) New Resource: netbox_virtual_chassis_master resource/netbox_primary_ip: Allow correctly importing primary IPs of dual-stack machines