-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature request] - Support netbox prefix bulk update #396
Comments
I feel that this style of api endpoint does not play particularly well with how terraform operates. Can you write some mock hcl code how this a As for your initial problem: After your initial apply (which will take long, granted), terraform will only apply things with diffs. You can use I find the idea intriguing, but I don't have the time experiment with this at the moment. I saw that netbox added these bulk operations sometime ago, but I did not look at them in detail. |
Hi @fbreckle Thanks for checking on this issue. Even though we use locals {
prefixmap = { for index in range(10, 100) : index => {
prefix = format("10.10.%s.0/24", index)
vlanid = index
}
}
}
resource "netbox_prefixes_bulk" "default" {
dynamic "prefix_bulk" {
for_each = local.prefixmap
content {
prefix = prefix_bulk.value.prefix
vlan_id = prefix_bulk.value.vlanid
site_id = 123
status = "active"
mark_utilized = true
tags = []
tenant_id = 111
vrf_id = 123
role_id = 456
}
}
} This resource would manage a list of prefixes above by one resource ID.
When it comes to drift detection,
Please let me know your thought, if needed, I can also offer a PR in this regard and you can check later. Thanks. |
Currently we have
netbox_prefix
resource to manage prefixes, but it takes lots of time to apply when there are tens of thousands prexes to be manged.Since bulk object management is supported via API, is it possible for us to introduce a new resource, something like
netbox_prefix_bulk
?Maybe this involves creating some PRs under this project and https://github.com/fbreckle/go-netbox/
The text was updated successfully, but these errors were encountered: