netbox 5.1.0 published on Monday, Jan 26, 2026 by e-breuninger
netbox 5.1.0 published on Monday, Jan 26, 2026 by e-breuninger
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as netbox from "@pulumi/netbox";
// Get all clusters of a specific type
const vmware = netbox.getClusterType({
name: "VMware ESXi",
});
const vmwareClusters = vmware.then(vmware => netbox.getClusters({
filters: [{
name: "cluster_type_id",
value: vmware.id,
}],
}));
// Get clusters by name regex
const prodClusters = netbox.getClusters({
nameRegex: "prod-.*",
});
// Get clusters at a specific site
const siteClusters = netbox.getClusters({
filters: [{
name: "site_id",
value: main.id,
}],
});
import pulumi
import pulumi_netbox as netbox
# Get all clusters of a specific type
vmware = netbox.get_cluster_type(name="VMware ESXi")
vmware_clusters = netbox.get_clusters(filters=[{
"name": "cluster_type_id",
"value": vmware.id,
}])
# Get clusters by name regex
prod_clusters = netbox.get_clusters(name_regex="prod-.*")
# Get clusters at a specific site
site_clusters = netbox.get_clusters(filters=[{
"name": "site_id",
"value": main["id"],
}])
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/netbox/v5/netbox"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
// Get all clusters of a specific type
vmware, err := netbox.LookupClusterType(ctx, &netbox.LookupClusterTypeArgs{
Name: "VMware ESXi",
}, nil)
if err != nil {
return err
}
_, err = netbox.GetClusters(ctx, &netbox.GetClustersArgs{
Filters: []netbox.GetClustersFilter{
{
Name: "cluster_type_id",
Value: vmware.Id,
},
},
}, nil)
if err != nil {
return err
}
// Get clusters by name regex
_, err = netbox.GetClusters(ctx, &netbox.GetClustersArgs{
NameRegex: pulumi.StringRef("prod-.*"),
}, nil)
if err != nil {
return err
}
// Get clusters at a specific site
_, err = netbox.GetClusters(ctx, &netbox.GetClustersArgs{
Filters: []netbox.GetClustersFilter{
{
Name: "site_id",
Value: main.Id,
},
},
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Netbox = Pulumi.Netbox;
return await Deployment.RunAsync(() =>
{
// Get all clusters of a specific type
var vmware = Netbox.GetClusterType.Invoke(new()
{
Name = "VMware ESXi",
});
var vmwareClusters = Netbox.GetClusters.Invoke(new()
{
Filters = new[]
{
new Netbox.Inputs.GetClustersFilterInputArgs
{
Name = "cluster_type_id",
Value = vmware.Apply(getClusterTypeResult => getClusterTypeResult.Id),
},
},
});
// Get clusters by name regex
var prodClusters = Netbox.GetClusters.Invoke(new()
{
NameRegex = "prod-.*",
});
// Get clusters at a specific site
var siteClusters = Netbox.GetClusters.Invoke(new()
{
Filters = new[]
{
new Netbox.Inputs.GetClustersFilterInputArgs
{
Name = "site_id",
Value = main.Id,
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.netbox.NetboxFunctions;
import com.pulumi.netbox.inputs.GetClusterTypeArgs;
import com.pulumi.netbox.inputs.GetClustersArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
// Get all clusters of a specific type
final var vmware = NetboxFunctions.getClusterType(GetClusterTypeArgs.builder()
.name("VMware ESXi")
.build());
final var vmwareClusters = NetboxFunctions.getClusters(GetClustersArgs.builder()
.filters(GetClustersFilterArgs.builder()
.name("cluster_type_id")
.value(vmware.id())
.build())
.build());
// Get clusters by name regex
final var prodClusters = NetboxFunctions.getClusters(GetClustersArgs.builder()
.nameRegex("prod-.*")
.build());
// Get clusters at a specific site
final var siteClusters = NetboxFunctions.getClusters(GetClustersArgs.builder()
.filters(GetClustersFilterArgs.builder()
.name("site_id")
.value(main.id())
.build())
.build());
}
}
variables:
# Get all clusters of a specific type
vmware:
fn::invoke:
function: netbox:getClusterType
arguments:
name: VMware ESXi
vmwareClusters:
fn::invoke:
function: netbox:getClusters
arguments:
filters:
- name: cluster_type_id
value: ${vmware.id}
# Get clusters by name regex
prodClusters:
fn::invoke:
function: netbox:getClusters
arguments:
nameRegex: prod-.*
# Get clusters at a specific site
siteClusters:
fn::invoke:
function: netbox:getClusters
arguments:
filters:
- name: site_id
value: ${main.id}
Using getClusters
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getClusters(args: GetClustersArgs, opts?: InvokeOptions): Promise<GetClustersResult>
function getClustersOutput(args: GetClustersOutputArgs, opts?: InvokeOptions): Output<GetClustersResult>def get_clusters(filters: Optional[Sequence[GetClustersFilter]] = None,
id: Optional[str] = None,
limit: Optional[float] = None,
name_regex: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetClustersResult
def get_clusters_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetClustersFilterArgs]]]] = None,
id: Optional[pulumi.Input[str]] = None,
limit: Optional[pulumi.Input[float]] = None,
name_regex: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetClustersResult]func GetClusters(ctx *Context, args *GetClustersArgs, opts ...InvokeOption) (*GetClustersResult, error)
func GetClustersOutput(ctx *Context, args *GetClustersOutputArgs, opts ...InvokeOption) GetClustersResultOutput> Note: This function is named GetClusters in the Go SDK.
public static class GetClusters
{
public static Task<GetClustersResult> InvokeAsync(GetClustersArgs args, InvokeOptions? opts = null)
public static Output<GetClustersResult> Invoke(GetClustersInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetClustersResult> getClusters(GetClustersArgs args, InvokeOptions options)
public static Output<GetClustersResult> getClusters(GetClustersArgs args, InvokeOptions options)
fn::invoke:
function: netbox:index/getClusters:getClusters
arguments:
# arguments dictionaryThe following arguments are supported:
- Filters
List<Get
Clusters Filter> - Id string
- The ID of this resource.
- Limit double
- Name
Regex string
- Filters
[]Get
Clusters Filter - Id string
- The ID of this resource.
- Limit float64
- Name
Regex string
- filters
List<Get
Clusters Filter> - id String
- The ID of this resource.
- limit Double
- name
Regex String
- filters
Get
Clusters Filter[] - id string
- The ID of this resource.
- limit number
- name
Regex string
- filters
Sequence[Get
Clusters Filter] - id str
- The ID of this resource.
- limit float
- name_
regex str
- filters List<Property Map>
- id String
- The ID of this resource.
- limit Number
- name
Regex String
getClusters Result
The following output properties are available:
- Clusters
List<Get
Clusters Cluster> - Id string
- The ID of this resource.
- Filters
List<Get
Clusters Filter> - Limit double
- Name
Regex string
- Clusters
[]Get
Clusters Cluster - Id string
- The ID of this resource.
- Filters
[]Get
Clusters Filter - Limit float64
- Name
Regex string
- clusters
List<Get
Clusters Cluster> - id String
- The ID of this resource.
- filters
List<Get
Clusters Filter> - limit Double
- name
Regex String
- clusters
Get
Clusters Cluster[] - id string
- The ID of this resource.
- filters
Get
Clusters Filter[] - limit number
- name
Regex string
- clusters
Sequence[Get
Clusters Cluster] - id str
- The ID of this resource.
- filters
Sequence[Get
Clusters Filter] - limit float
- name_
regex str
- clusters List<Property Map>
- id String
- The ID of this resource.
- filters List<Property Map>
- limit Number
- name
Regex String
Supporting Types
GetClustersCluster
- Cluster
Group doubleId - Cluster
Id double - Cluster
Type doubleId - Comments string
- Custom
Fields Dictionary<string, string> - Description string
- Location
Id double - Name string
- Region
Id double - Scope
Id double - Scope
Type string - Site
Group doubleId - Site
Id double - List<string>
- Tenant
Id double
- Cluster
Group float64Id - Cluster
Id float64 - Cluster
Type float64Id - Comments string
- Custom
Fields map[string]string - Description string
- Location
Id float64 - Name string
- Region
Id float64 - Scope
Id float64 - Scope
Type string - Site
Group float64Id - Site
Id float64 - []string
- Tenant
Id float64
- cluster
Group DoubleId - cluster
Id Double - cluster
Type DoubleId - comments String
- custom
Fields Map<String,String> - description String
- location
Id Double - name String
- region
Id Double - scope
Id Double - scope
Type String - site
Group DoubleId - site
Id Double - List<String>
- tenant
Id Double
- cluster
Group numberId - cluster
Id number - cluster
Type numberId - comments string
- custom
Fields {[key: string]: string} - description string
- location
Id number - name string
- region
Id number - scope
Id number - scope
Type string - site
Group numberId - site
Id number - string[]
- tenant
Id number
- cluster_
group_ floatid - cluster_
id float - cluster_
type_ floatid - comments str
- custom_
fields Mapping[str, str] - description str
- location_
id float - name str
- region_
id float - scope_
id float - scope_
type str - site_
group_ floatid - site_
id float - Sequence[str]
- tenant_
id float
- cluster
Group NumberId - cluster
Id Number - cluster
Type NumberId - comments String
- custom
Fields Map<String> - description String
- location
Id Number - name String
- region
Id Number - scope
Id Number - scope
Type String - site
Group NumberId - site
Id Number - List<String>
- tenant
Id Number
GetClustersFilter
Package Details
- Repository
- netbox e-breuninger/terraform-provider-netbox
- License
- Notes
- This Pulumi package is based on the
netboxTerraform Provider.
netbox 5.1.0 published on Monday, Jan 26, 2026 by e-breuninger
