published on Wednesday, Nov 4, 2026 by e-breuninger
published on Wednesday, Nov 4, 2026 by e-breuninger
A NetBox prefix (ipam.prefix).
From the official documentation:
A prefix is an IPv4 or IPv6 network and mask expressed in CIDR notation (e.g. 192.0.2.0/24). A prefix entails only the “network portion” of an IP address: All bits in the address not covered by the mask must be zero. (In other words, a prefix cannot be a specific IP address.)
Prefixes are automatically organized by their parent aggregates. Additionally, each prefix can be assigned to a particular site and virtual routing and forwarding instance (VRF). Each VRF represents a separate IP space or routing table. All prefixes not assigned to a VRF are considered to be in the “global” table.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as netbox from "@pulumi/netbox";
const test = new netbox.Site("test", {name: "test-site"});
const testTenant = new netbox.Tenant("test", {name: "test-tenant"});
const testVrf = new netbox.Vrf("test", {name: "test-vrf"});
const testIpamRole = new netbox.IpamRole("test", {name: "test-ipam-role"});
const testVlan = new netbox.Vlan("test", {
name: "test-vlan",
vid: 100,
});
const testPrefix = new netbox.Prefix("test", {
prefix: "192.0.2.0/24",
status: "active",
isPool: true,
markUtilized: false,
description: "test-description",
tenantId: testTenant.tenantId,
vrfId: testVrf.vrfId,
roleId: testIpamRole.ipamRoleId,
vlanId: testVlan.vlanId,
siteId: test.siteId,
});
import pulumi
import pulumi_netbox as netbox
test = netbox.Site("test", name="test-site")
test_tenant = netbox.Tenant("test", name="test-tenant")
test_vrf = netbox.Vrf("test", name="test-vrf")
test_ipam_role = netbox.IpamRole("test", name="test-ipam-role")
test_vlan = netbox.Vlan("test",
name="test-vlan",
vid=100)
test_prefix = netbox.Prefix("test",
prefix="192.0.2.0/24",
status="active",
is_pool=True,
mark_utilized=False,
description="test-description",
tenant_id=test_tenant.tenant_id,
vrf_id=test_vrf.vrf_id,
role_id=test_ipam_role.ipam_role_id,
vlan_id=test_vlan.vlan_id,
site_id=test.site_id)
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/netbox/v6/netbox"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
test, err := netbox.NewSite(ctx, "test", &netbox.SiteArgs{
Name: pulumi.String("test-site"),
})
if err != nil {
return err
}
testTenant, err := netbox.NewTenant(ctx, "test", &netbox.TenantArgs{
Name: pulumi.String("test-tenant"),
})
if err != nil {
return err
}
testVrf, err := netbox.NewVrf(ctx, "test", &netbox.VrfArgs{
Name: pulumi.String("test-vrf"),
})
if err != nil {
return err
}
testIpamRole, err := netbox.NewIpamRole(ctx, "test", &netbox.IpamRoleArgs{
Name: pulumi.String("test-ipam-role"),
})
if err != nil {
return err
}
testVlan, err := netbox.NewVlan(ctx, "test", &netbox.VlanArgs{
Name: pulumi.String("test-vlan"),
Vid: pulumi.Float64(100),
})
if err != nil {
return err
}
_, err = netbox.NewPrefix(ctx, "test", &netbox.PrefixArgs{
Prefix: pulumi.String("192.0.2.0/24"),
Status: pulumi.String("active"),
IsPool: pulumi.Bool(true),
MarkUtilized: pulumi.Bool(false),
Description: pulumi.String("test-description"),
TenantId: testTenant.TenantId,
VrfId: testVrf.VrfId,
RoleId: testIpamRole.IpamRoleId,
VlanId: testVlan.VlanId,
SiteId: test.SiteId,
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Netbox = Pulumi.Netbox;
return await Deployment.RunAsync(() =>
{
var test = new Netbox.Site("test", new()
{
Name = "test-site",
});
var testTenant = new Netbox.Tenant("test", new()
{
Name = "test-tenant",
});
var testVrf = new Netbox.Vrf("test", new()
{
Name = "test-vrf",
});
var testIpamRole = new Netbox.IpamRole("test", new()
{
Name = "test-ipam-role",
});
var testVlan = new Netbox.Vlan("test", new()
{
Name = "test-vlan",
Vid = 100,
});
var testPrefix = new Netbox.Prefix("test", new()
{
Prefix = "192.0.2.0/24",
Status = "active",
IsPool = true,
MarkUtilized = false,
Description = "test-description",
TenantId = testTenant.TenantId,
VrfId = testVrf.VrfId,
RoleId = testIpamRole.IpamRoleId,
VlanId = testVlan.VlanId,
SiteId = test.SiteId,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.netbox.Site;
import com.pulumi.netbox.SiteArgs;
import com.pulumi.netbox.Tenant;
import com.pulumi.netbox.TenantArgs;
import com.pulumi.netbox.Vrf;
import com.pulumi.netbox.VrfArgs;
import com.pulumi.netbox.IpamRole;
import com.pulumi.netbox.IpamRoleArgs;
import com.pulumi.netbox.Vlan;
import com.pulumi.netbox.VlanArgs;
import com.pulumi.netbox.Prefix;
import com.pulumi.netbox.PrefixArgs;
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) {
var test = new Site("test", SiteArgs.builder()
.name("test-site")
.build());
var testTenant = new Tenant("testTenant", TenantArgs.builder()
.name("test-tenant")
.build());
var testVrf = new Vrf("testVrf", VrfArgs.builder()
.name("test-vrf")
.build());
var testIpamRole = new IpamRole("testIpamRole", IpamRoleArgs.builder()
.name("test-ipam-role")
.build());
var testVlan = new Vlan("testVlan", VlanArgs.builder()
.name("test-vlan")
.vid(100.0)
.build());
var testPrefix = new Prefix("testPrefix", PrefixArgs.builder()
.prefix("192.0.2.0/24")
.status("active")
.isPool(true)
.markUtilized(false)
.description("test-description")
.tenantId(testTenant.tenantId())
.vrfId(testVrf.vrfId())
.roleId(testIpamRole.ipamRoleId())
.vlanId(testVlan.vlanId())
.siteId(test.siteId())
.build());
}
}
resources:
test:
type: netbox:Site
properties:
name: test-site
testTenant:
type: netbox:Tenant
name: test
properties:
name: test-tenant
testVrf:
type: netbox:Vrf
name: test
properties:
name: test-vrf
testIpamRole:
type: netbox:IpamRole
name: test
properties:
name: test-ipam-role
testVlan:
type: netbox:Vlan
name: test
properties:
name: test-vlan
vid: 100
testPrefix:
type: netbox:Prefix
name: test
properties:
prefix: 192.0.2.0/24
status: active
isPool: true
markUtilized: false
description: test-description
tenantId: ${testTenant.tenantId}
vrfId: ${testVrf.vrfId}
roleId: ${testIpamRole.ipamRoleId}
vlanId: ${testVlan.vlanId}
siteId: ${test.siteId}
Example coming soon!
Create Prefix Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Prefix(name: string, args: PrefixArgs, opts?: CustomResourceOptions);@overload
def Prefix(resource_name: str,
args: PrefixArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Prefix(resource_name: str,
opts: Optional[ResourceOptions] = None,
prefix: Optional[str] = None,
region_id: Optional[float] = None,
scope_type: Optional[str] = None,
is_pool: Optional[bool] = None,
location_id: Optional[float] = None,
mark_utilized: Optional[bool] = None,
owner_id: Optional[float] = None,
custom_fields: Optional[Mapping[str, str]] = None,
comments: Optional[str] = None,
description: Optional[str] = None,
role_id: Optional[float] = None,
scope_id: Optional[float] = None,
site_group_id: Optional[float] = None,
site_id: Optional[float] = None,
status: Optional[str] = None,
tags: Optional[Sequence[str]] = None,
tenant_id: Optional[float] = None,
vlan_id: Optional[float] = None,
vrf_id: Optional[float] = None)func NewPrefix(ctx *Context, name string, args PrefixArgs, opts ...ResourceOption) (*Prefix, error)public Prefix(string name, PrefixArgs args, CustomResourceOptions? opts = null)
public Prefix(String name, PrefixArgs args)
public Prefix(String name, PrefixArgs args, CustomResourceOptions options)
type: netbox:Prefix
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
resource "netbox_prefix" "name" {
# resource properties
}Parameters
- name string
- The unique name of the resource.
- args PrefixArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args PrefixArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args PrefixArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args PrefixArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args PrefixArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var prefixResource = new Netbox.Prefix("prefixResource", new()
{
Prefix = "string",
RegionId = 0.0,
ScopeType = "string",
IsPool = false,
LocationId = 0.0,
MarkUtilized = false,
OwnerId = 0.0,
CustomFields =
{
{ "string", "string" },
},
Comments = "string",
Description = "string",
RoleId = 0.0,
ScopeId = 0.0,
SiteGroupId = 0.0,
SiteId = 0.0,
Status = "string",
Tags = new[]
{
"string",
},
TenantId = 0.0,
VlanId = 0.0,
VrfId = 0.0,
});
example, err := netbox.NewPrefix(ctx, "prefixResource", &netbox.PrefixArgs{
Prefix: pulumi.String("string"),
RegionId: pulumi.Float64(0),
ScopeType: pulumi.String("string"),
IsPool: pulumi.Bool(false),
LocationId: pulumi.Float64(0),
MarkUtilized: pulumi.Bool(false),
OwnerId: pulumi.Float64(0),
CustomFields: pulumi.StringMap{
"string": pulumi.String("string"),
},
Comments: pulumi.String("string"),
Description: pulumi.String("string"),
RoleId: pulumi.Float64(0),
ScopeId: pulumi.Float64(0),
SiteGroupId: pulumi.Float64(0),
SiteId: pulumi.Float64(0),
Status: pulumi.String("string"),
Tags: pulumi.StringArray{
pulumi.String("string"),
},
TenantId: pulumi.Float64(0),
VlanId: pulumi.Float64(0),
VrfId: pulumi.Float64(0),
})
resource "netbox_prefix" "prefixResource" {
lifecycle {
create_before_destroy = true
}
prefix = "string"
region_id = 0
scope_type = "string"
is_pool = false
location_id = 0
mark_utilized = false
owner_id = 0
custom_fields = {
"string" = "string"
}
comments = "string"
description = "string"
role_id = 0
scope_id = 0
site_group_id = 0
site_id = 0
status = "string"
tags = ["string"]
tenant_id = 0
vlan_id = 0
vrf_id = 0
}
var prefixResource = new Prefix("prefixResource", PrefixArgs.builder()
.prefix("string")
.regionId(0.0)
.scopeType("string")
.isPool(false)
.locationId(0.0)
.markUtilized(false)
.ownerId(0.0)
.customFields(Map.of("string", "string"))
.comments("string")
.description("string")
.roleId(0.0)
.scopeId(0.0)
.siteGroupId(0.0)
.siteId(0.0)
.status("string")
.tags("string")
.tenantId(0.0)
.vlanId(0.0)
.vrfId(0.0)
.build());
prefix_resource = netbox.Prefix("prefixResource",
prefix="string",
region_id=float(0),
scope_type="string",
is_pool=False,
location_id=float(0),
mark_utilized=False,
owner_id=float(0),
custom_fields={
"string": "string",
},
comments="string",
description="string",
role_id=float(0),
scope_id=float(0),
site_group_id=float(0),
site_id=float(0),
status="string",
tags=["string"],
tenant_id=float(0),
vlan_id=float(0),
vrf_id=float(0))
const prefixResource = new netbox.Prefix("prefixResource", {
prefix: "string",
regionId: 0,
scopeType: "string",
isPool: false,
locationId: 0,
markUtilized: false,
ownerId: 0,
customFields: {
string: "string",
},
comments: "string",
description: "string",
roleId: 0,
scopeId: 0,
siteGroupId: 0,
siteId: 0,
status: "string",
tags: ["string"],
tenantId: 0,
vlanId: 0,
vrfId: 0,
});
type: netbox:Prefix
properties:
comments: string
customFields:
string: string
description: string
isPool: false
locationId: 0
markUtilized: false
ownerId: 0
prefix: string
regionId: 0
roleId: 0
scopeId: 0
scopeType: string
siteGroupId: 0
siteId: 0
status: string
tags:
- string
tenantId: 0
vlanId: 0
vrfId: 0
Prefix Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The Prefix resource accepts the following input properties:
- Prefix string
- IPv4 or IPv6 network with mask, e.g. 10.0.0.0/24.
- Comments string
- Custom
Fields Dictionary<string, string> - Custom field values by field name. Every value is a string; NetBox coerces numbers and booleans. An object field holds the related object's id, e.g. "12", a multiobject field a JSON list of ids in any order, e.g. jsonencode([12, 13]). A key removed from the map is cleared in NetBox (set {} to clear all).
- Description string
- Is
Pool bool - All addresses within this prefix are usable.
- Location
Id double - Id of the location the object is scoped to (scope_type dcim.location).
- Mark
Utilized bool - Report space as fully utilized.
- Owner
Id double - Id of the owner the object is assigned to.
- Region
Id double - Id of the region the object is scoped to (scope_type dcim.region).
- Role
Id double - Id of the role.
- Scope
Id double - Id of the scope object (see scope_type).
- Scope
Type string - Content type of the scope. Derived from siteid, locationid, regionid or sitegroupid when one of those is set; set it together with scopeid otherwise. One of: dcim.site, dcim.location, dcim.region, dcim.sitegroup.
- Site
Group doubleId - Id of the site group the object is scoped to (scope_type dcim.sitegroup).
- Site
Id double - Id of the site the object is scoped to (scope*type dcim.site). Conflicts with the other scope aliases and with setting the scope** pair directly.
- Status string
- Operational status. One of: container, active, reserved, deprecated.
- List<string>
- Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
- Tenant
Id double - Id of the tenant.
- Vlan
Id double - Id of the VLAN.
- Vrf
Id double - Id of the VRF.
- Prefix string
- IPv4 or IPv6 network with mask, e.g. 10.0.0.0/24.
- Comments string
- Custom
Fields map[string]string - Custom field values by field name. Every value is a string; NetBox coerces numbers and booleans. An object field holds the related object's id, e.g. "12", a multiobject field a JSON list of ids in any order, e.g. jsonencode([12, 13]). A key removed from the map is cleared in NetBox (set {} to clear all).
- Description string
- Is
Pool bool - All addresses within this prefix are usable.
- Location
Id float64 - Id of the location the object is scoped to (scope_type dcim.location).
- Mark
Utilized bool - Report space as fully utilized.
- Owner
Id float64 - Id of the owner the object is assigned to.
- Region
Id float64 - Id of the region the object is scoped to (scope_type dcim.region).
- Role
Id float64 - Id of the role.
- Scope
Id float64 - Id of the scope object (see scope_type).
- Scope
Type string - Content type of the scope. Derived from siteid, locationid, regionid or sitegroupid when one of those is set; set it together with scopeid otherwise. One of: dcim.site, dcim.location, dcim.region, dcim.sitegroup.
- Site
Group float64Id - Id of the site group the object is scoped to (scope_type dcim.sitegroup).
- Site
Id float64 - Id of the site the object is scoped to (scope*type dcim.site). Conflicts with the other scope aliases and with setting the scope** pair directly.
- Status string
- Operational status. One of: container, active, reserved, deprecated.
- []string
- Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
- Tenant
Id float64 - Id of the tenant.
- Vlan
Id float64 - Id of the VLAN.
- Vrf
Id float64 - Id of the VRF.
- prefix string
- IPv4 or IPv6 network with mask, e.g. 10.0.0.0/24.
- comments string
- custom_
fields map(string) - Custom field values by field name. Every value is a string; NetBox coerces numbers and booleans. An object field holds the related object's id, e.g. "12", a multiobject field a JSON list of ids in any order, e.g. jsonencode([12, 13]). A key removed from the map is cleared in NetBox (set {} to clear all).
- description string
- is_
pool bool - All addresses within this prefix are usable.
- location_
id number - Id of the location the object is scoped to (scope_type dcim.location).
- mark_
utilized bool - Report space as fully utilized.
- owner_
id number - Id of the owner the object is assigned to.
- region_
id number - Id of the region the object is scoped to (scope_type dcim.region).
- role_
id number - Id of the role.
- scope_
id number - Id of the scope object (see scope_type).
- scope_
type string - Content type of the scope. Derived from siteid, locationid, regionid or sitegroupid when one of those is set; set it together with scopeid otherwise. One of: dcim.site, dcim.location, dcim.region, dcim.sitegroup.
- site_
group_ numberid - Id of the site group the object is scoped to (scope_type dcim.sitegroup).
- site_
id number - Id of the site the object is scoped to (scope*type dcim.site). Conflicts with the other scope aliases and with setting the scope** pair directly.
- status string
- Operational status. One of: container, active, reserved, deprecated.
- list(string)
- Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
- tenant_
id number - Id of the tenant.
- vlan_
id number - Id of the VLAN.
- vrf_
id number - Id of the VRF.
- prefix String
- IPv4 or IPv6 network with mask, e.g. 10.0.0.0/24.
- comments String
- custom
Fields Map<String,String> - Custom field values by field name. Every value is a string; NetBox coerces numbers and booleans. An object field holds the related object's id, e.g. "12", a multiobject field a JSON list of ids in any order, e.g. jsonencode([12, 13]). A key removed from the map is cleared in NetBox (set {} to clear all).
- description String
- is
Pool Boolean - All addresses within this prefix are usable.
- location
Id Double - Id of the location the object is scoped to (scope_type dcim.location).
- mark
Utilized Boolean - Report space as fully utilized.
- owner
Id Double - Id of the owner the object is assigned to.
- region
Id Double - Id of the region the object is scoped to (scope_type dcim.region).
- role
Id Double - Id of the role.
- scope
Id Double - Id of the scope object (see scope_type).
- scope
Type String - Content type of the scope. Derived from siteid, locationid, regionid or sitegroupid when one of those is set; set it together with scopeid otherwise. One of: dcim.site, dcim.location, dcim.region, dcim.sitegroup.
- site
Group DoubleId - Id of the site group the object is scoped to (scope_type dcim.sitegroup).
- site
Id Double - Id of the site the object is scoped to (scope*type dcim.site). Conflicts with the other scope aliases and with setting the scope** pair directly.
- status String
- Operational status. One of: container, active, reserved, deprecated.
- List<String>
- Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
- tenant
Id Double - Id of the tenant.
- vlan
Id Double - Id of the VLAN.
- vrf
Id Double - Id of the VRF.
- prefix string
- IPv4 or IPv6 network with mask, e.g. 10.0.0.0/24.
- comments string
- custom
Fields {[key: string]: string} - Custom field values by field name. Every value is a string; NetBox coerces numbers and booleans. An object field holds the related object's id, e.g. "12", a multiobject field a JSON list of ids in any order, e.g. jsonencode([12, 13]). A key removed from the map is cleared in NetBox (set {} to clear all).
- description string
- is
Pool boolean - All addresses within this prefix are usable.
- location
Id number - Id of the location the object is scoped to (scope_type dcim.location).
- mark
Utilized boolean - Report space as fully utilized.
- owner
Id number - Id of the owner the object is assigned to.
- region
Id number - Id of the region the object is scoped to (scope_type dcim.region).
- role
Id number - Id of the role.
- scope
Id number - Id of the scope object (see scope_type).
- scope
Type string - Content type of the scope. Derived from siteid, locationid, regionid or sitegroupid when one of those is set; set it together with scopeid otherwise. One of: dcim.site, dcim.location, dcim.region, dcim.sitegroup.
- site
Group numberId - Id of the site group the object is scoped to (scope_type dcim.sitegroup).
- site
Id number - Id of the site the object is scoped to (scope*type dcim.site). Conflicts with the other scope aliases and with setting the scope** pair directly.
- status string
- Operational status. One of: container, active, reserved, deprecated.
- string[]
- Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
- tenant
Id number - Id of the tenant.
- vlan
Id number - Id of the VLAN.
- vrf
Id number - Id of the VRF.
- prefix str
- IPv4 or IPv6 network with mask, e.g. 10.0.0.0/24.
- comments str
- custom_
fields Mapping[str, str] - Custom field values by field name. Every value is a string; NetBox coerces numbers and booleans. An object field holds the related object's id, e.g. "12", a multiobject field a JSON list of ids in any order, e.g. jsonencode([12, 13]). A key removed from the map is cleared in NetBox (set {} to clear all).
- description str
- is_
pool bool - All addresses within this prefix are usable.
- location_
id float - Id of the location the object is scoped to (scope_type dcim.location).
- mark_
utilized bool - Report space as fully utilized.
- owner_
id float - Id of the owner the object is assigned to.
- region_
id float - Id of the region the object is scoped to (scope_type dcim.region).
- role_
id float - Id of the role.
- scope_
id float - Id of the scope object (see scope_type).
- scope_
type str - Content type of the scope. Derived from siteid, locationid, regionid or sitegroupid when one of those is set; set it together with scopeid otherwise. One of: dcim.site, dcim.location, dcim.region, dcim.sitegroup.
- site_
group_ floatid - Id of the site group the object is scoped to (scope_type dcim.sitegroup).
- site_
id float - Id of the site the object is scoped to (scope*type dcim.site). Conflicts with the other scope aliases and with setting the scope** pair directly.
- status str
- Operational status. One of: container, active, reserved, deprecated.
- Sequence[str]
- Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
- tenant_
id float - Id of the tenant.
- vlan_
id float - Id of the VLAN.
- vrf_
id float - Id of the VRF.
- prefix String
- IPv4 or IPv6 network with mask, e.g. 10.0.0.0/24.
- comments String
- custom
Fields Map<String> - Custom field values by field name. Every value is a string; NetBox coerces numbers and booleans. An object field holds the related object's id, e.g. "12", a multiobject field a JSON list of ids in any order, e.g. jsonencode([12, 13]). A key removed from the map is cleared in NetBox (set {} to clear all).
- description String
- is
Pool Boolean - All addresses within this prefix are usable.
- location
Id Number - Id of the location the object is scoped to (scope_type dcim.location).
- mark
Utilized Boolean - Report space as fully utilized.
- owner
Id Number - Id of the owner the object is assigned to.
- region
Id Number - Id of the region the object is scoped to (scope_type dcim.region).
- role
Id Number - Id of the role.
- scope
Id Number - Id of the scope object (see scope_type).
- scope
Type String - Content type of the scope. Derived from siteid, locationid, regionid or sitegroupid when one of those is set; set it together with scopeid otherwise. One of: dcim.site, dcim.location, dcim.region, dcim.sitegroup.
- site
Group NumberId - Id of the site group the object is scoped to (scope_type dcim.sitegroup).
- site
Id Number - Id of the site the object is scoped to (scope*type dcim.site). Conflicts with the other scope aliases and with setting the scope** pair directly.
- status String
- Operational status. One of: container, active, reserved, deprecated.
- List<String>
- Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
- tenant
Id Number - Id of the tenant.
- vlan
Id Number - Id of the VLAN.
- vrf
Id Number - Id of the VRF.
Outputs
All input properties are implicitly available as output properties. Additionally, the Prefix resource produces the following output properties:
Look up Existing Prefix Resource
Get an existing Prefix resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: PrefixState, opts?: CustomResourceOptions): Prefix@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
comments: Optional[str] = None,
created: Optional[str] = None,
custom_fields: Optional[Mapping[str, str]] = None,
description: Optional[str] = None,
family: Optional[float] = None,
is_pool: Optional[bool] = None,
last_updated: Optional[str] = None,
location_id: Optional[float] = None,
mark_utilized: Optional[bool] = None,
owner_id: Optional[float] = None,
prefix: Optional[str] = None,
prefix_id: Optional[float] = None,
region_id: Optional[float] = None,
role_id: Optional[float] = None,
scope_id: Optional[float] = None,
scope_type: Optional[str] = None,
site_group_id: Optional[float] = None,
site_id: Optional[float] = None,
status: Optional[str] = None,
tags: Optional[Sequence[str]] = None,
tags_alls: Optional[Sequence[str]] = None,
tenant_id: Optional[float] = None,
url: Optional[str] = None,
vlan_id: Optional[float] = None,
vrf_id: Optional[float] = None) -> Prefixfunc GetPrefix(ctx *Context, name string, id IDInput, state *PrefixState, opts ...ResourceOption) (*Prefix, error)public static Prefix Get(string name, Input<string> id, PrefixState? state, CustomResourceOptions? opts = null)public static Prefix get(String name, Output<String> id, PrefixState state, CustomResourceOptions options)resources: _: type: netbox:Prefix get: id: ${id}import {
to = netbox_prefix.example
id = "${id}"
}
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Comments string
- Created string
- Custom
Fields Dictionary<string, string> - Custom field values by field name. Every value is a string; NetBox coerces numbers and booleans. An object field holds the related object's id, e.g. "12", a multiobject field a JSON list of ids in any order, e.g. jsonencode([12, 13]). A key removed from the map is cleared in NetBox (set {} to clear all).
- Description string
- Family double
- Address family: 4 or 6.
- Is
Pool bool - All addresses within this prefix are usable.
- Last
Updated string - Location
Id double - Id of the location the object is scoped to (scope_type dcim.location).
- Mark
Utilized bool - Report space as fully utilized.
- Owner
Id double - Id of the owner the object is assigned to.
- Prefix string
- IPv4 or IPv6 network with mask, e.g. 10.0.0.0/24.
- Prefix
Id double - NetBox id.
- Region
Id double - Id of the region the object is scoped to (scope_type dcim.region).
- Role
Id double - Id of the role.
- Scope
Id double - Id of the scope object (see scope_type).
- Scope
Type string - Content type of the scope. Derived from siteid, locationid, regionid or sitegroupid when one of those is set; set it together with scopeid otherwise. One of: dcim.site, dcim.location, dcim.region, dcim.sitegroup.
- Site
Group doubleId - Id of the site group the object is scoped to (scope_type dcim.sitegroup).
- Site
Id double - Id of the site the object is scoped to (scope*type dcim.site). Conflicts with the other scope aliases and with setting the scope** pair directly.
- Status string
- Operational status. One of: container, active, reserved, deprecated.
- List<string>
- Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
- List<string>
- Slugs of all tags on the object, including the provider's default_tags.
- Tenant
Id double - Id of the tenant.
- Url string
- Vlan
Id double - Id of the VLAN.
- Vrf
Id double - Id of the VRF.
- Comments string
- Created string
- Custom
Fields map[string]string - Custom field values by field name. Every value is a string; NetBox coerces numbers and booleans. An object field holds the related object's id, e.g. "12", a multiobject field a JSON list of ids in any order, e.g. jsonencode([12, 13]). A key removed from the map is cleared in NetBox (set {} to clear all).
- Description string
- Family float64
- Address family: 4 or 6.
- Is
Pool bool - All addresses within this prefix are usable.
- Last
Updated string - Location
Id float64 - Id of the location the object is scoped to (scope_type dcim.location).
- Mark
Utilized bool - Report space as fully utilized.
- Owner
Id float64 - Id of the owner the object is assigned to.
- Prefix string
- IPv4 or IPv6 network with mask, e.g. 10.0.0.0/24.
- Prefix
Id float64 - NetBox id.
- Region
Id float64 - Id of the region the object is scoped to (scope_type dcim.region).
- Role
Id float64 - Id of the role.
- Scope
Id float64 - Id of the scope object (see scope_type).
- Scope
Type string - Content type of the scope. Derived from siteid, locationid, regionid or sitegroupid when one of those is set; set it together with scopeid otherwise. One of: dcim.site, dcim.location, dcim.region, dcim.sitegroup.
- Site
Group float64Id - Id of the site group the object is scoped to (scope_type dcim.sitegroup).
- Site
Id float64 - Id of the site the object is scoped to (scope*type dcim.site). Conflicts with the other scope aliases and with setting the scope** pair directly.
- Status string
- Operational status. One of: container, active, reserved, deprecated.
- []string
- Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
- []string
- Slugs of all tags on the object, including the provider's default_tags.
- Tenant
Id float64 - Id of the tenant.
- Url string
- Vlan
Id float64 - Id of the VLAN.
- Vrf
Id float64 - Id of the VRF.
- comments string
- created string
- custom_
fields map(string) - Custom field values by field name. Every value is a string; NetBox coerces numbers and booleans. An object field holds the related object's id, e.g. "12", a multiobject field a JSON list of ids in any order, e.g. jsonencode([12, 13]). A key removed from the map is cleared in NetBox (set {} to clear all).
- description string
- family number
- Address family: 4 or 6.
- is_
pool bool - All addresses within this prefix are usable.
- last_
updated string - location_
id number - Id of the location the object is scoped to (scope_type dcim.location).
- mark_
utilized bool - Report space as fully utilized.
- owner_
id number - Id of the owner the object is assigned to.
- prefix string
- IPv4 or IPv6 network with mask, e.g. 10.0.0.0/24.
- prefix_
id number - NetBox id.
- region_
id number - Id of the region the object is scoped to (scope_type dcim.region).
- role_
id number - Id of the role.
- scope_
id number - Id of the scope object (see scope_type).
- scope_
type string - Content type of the scope. Derived from siteid, locationid, regionid or sitegroupid when one of those is set; set it together with scopeid otherwise. One of: dcim.site, dcim.location, dcim.region, dcim.sitegroup.
- site_
group_ numberid - Id of the site group the object is scoped to (scope_type dcim.sitegroup).
- site_
id number - Id of the site the object is scoped to (scope*type dcim.site). Conflicts with the other scope aliases and with setting the scope** pair directly.
- status string
- Operational status. One of: container, active, reserved, deprecated.
- list(string)
- Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
- list(string)
- Slugs of all tags on the object, including the provider's default_tags.
- tenant_
id number - Id of the tenant.
- url string
- vlan_
id number - Id of the VLAN.
- vrf_
id number - Id of the VRF.
- comments String
- created String
- custom
Fields Map<String,String> - Custom field values by field name. Every value is a string; NetBox coerces numbers and booleans. An object field holds the related object's id, e.g. "12", a multiobject field a JSON list of ids in any order, e.g. jsonencode([12, 13]). A key removed from the map is cleared in NetBox (set {} to clear all).
- description String
- family Double
- Address family: 4 or 6.
- is
Pool Boolean - All addresses within this prefix are usable.
- last
Updated String - location
Id Double - Id of the location the object is scoped to (scope_type dcim.location).
- mark
Utilized Boolean - Report space as fully utilized.
- owner
Id Double - Id of the owner the object is assigned to.
- prefix String
- IPv4 or IPv6 network with mask, e.g. 10.0.0.0/24.
- prefix
Id Double - NetBox id.
- region
Id Double - Id of the region the object is scoped to (scope_type dcim.region).
- role
Id Double - Id of the role.
- scope
Id Double - Id of the scope object (see scope_type).
- scope
Type String - Content type of the scope. Derived from siteid, locationid, regionid or sitegroupid when one of those is set; set it together with scopeid otherwise. One of: dcim.site, dcim.location, dcim.region, dcim.sitegroup.
- site
Group DoubleId - Id of the site group the object is scoped to (scope_type dcim.sitegroup).
- site
Id Double - Id of the site the object is scoped to (scope*type dcim.site). Conflicts with the other scope aliases and with setting the scope** pair directly.
- status String
- Operational status. One of: container, active, reserved, deprecated.
- List<String>
- Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
- List<String>
- Slugs of all tags on the object, including the provider's default_tags.
- tenant
Id Double - Id of the tenant.
- url String
- vlan
Id Double - Id of the VLAN.
- vrf
Id Double - Id of the VRF.
- comments string
- created string
- custom
Fields {[key: string]: string} - Custom field values by field name. Every value is a string; NetBox coerces numbers and booleans. An object field holds the related object's id, e.g. "12", a multiobject field a JSON list of ids in any order, e.g. jsonencode([12, 13]). A key removed from the map is cleared in NetBox (set {} to clear all).
- description string
- family number
- Address family: 4 or 6.
- is
Pool boolean - All addresses within this prefix are usable.
- last
Updated string - location
Id number - Id of the location the object is scoped to (scope_type dcim.location).
- mark
Utilized boolean - Report space as fully utilized.
- owner
Id number - Id of the owner the object is assigned to.
- prefix string
- IPv4 or IPv6 network with mask, e.g. 10.0.0.0/24.
- prefix
Id number - NetBox id.
- region
Id number - Id of the region the object is scoped to (scope_type dcim.region).
- role
Id number - Id of the role.
- scope
Id number - Id of the scope object (see scope_type).
- scope
Type string - Content type of the scope. Derived from siteid, locationid, regionid or sitegroupid when one of those is set; set it together with scopeid otherwise. One of: dcim.site, dcim.location, dcim.region, dcim.sitegroup.
- site
Group numberId - Id of the site group the object is scoped to (scope_type dcim.sitegroup).
- site
Id number - Id of the site the object is scoped to (scope*type dcim.site). Conflicts with the other scope aliases and with setting the scope** pair directly.
- status string
- Operational status. One of: container, active, reserved, deprecated.
- string[]
- Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
- string[]
- Slugs of all tags on the object, including the provider's default_tags.
- tenant
Id number - Id of the tenant.
- url string
- vlan
Id number - Id of the VLAN.
- vrf
Id number - Id of the VRF.
- comments str
- created str
- custom_
fields Mapping[str, str] - Custom field values by field name. Every value is a string; NetBox coerces numbers and booleans. An object field holds the related object's id, e.g. "12", a multiobject field a JSON list of ids in any order, e.g. jsonencode([12, 13]). A key removed from the map is cleared in NetBox (set {} to clear all).
- description str
- family float
- Address family: 4 or 6.
- is_
pool bool - All addresses within this prefix are usable.
- last_
updated str - location_
id float - Id of the location the object is scoped to (scope_type dcim.location).
- mark_
utilized bool - Report space as fully utilized.
- owner_
id float - Id of the owner the object is assigned to.
- prefix str
- IPv4 or IPv6 network with mask, e.g. 10.0.0.0/24.
- prefix_
id float - NetBox id.
- region_
id float - Id of the region the object is scoped to (scope_type dcim.region).
- role_
id float - Id of the role.
- scope_
id float - Id of the scope object (see scope_type).
- scope_
type str - Content type of the scope. Derived from siteid, locationid, regionid or sitegroupid when one of those is set; set it together with scopeid otherwise. One of: dcim.site, dcim.location, dcim.region, dcim.sitegroup.
- site_
group_ floatid - Id of the site group the object is scoped to (scope_type dcim.sitegroup).
- site_
id float - Id of the site the object is scoped to (scope*type dcim.site). Conflicts with the other scope aliases and with setting the scope** pair directly.
- status str
- Operational status. One of: container, active, reserved, deprecated.
- Sequence[str]
- Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
- Sequence[str]
- Slugs of all tags on the object, including the provider's default_tags.
- tenant_
id float - Id of the tenant.
- url str
- vlan_
id float - Id of the VLAN.
- vrf_
id float - Id of the VRF.
- comments String
- created String
- custom
Fields Map<String> - Custom field values by field name. Every value is a string; NetBox coerces numbers and booleans. An object field holds the related object's id, e.g. "12", a multiobject field a JSON list of ids in any order, e.g. jsonencode([12, 13]). A key removed from the map is cleared in NetBox (set {} to clear all).
- description String
- family Number
- Address family: 4 or 6.
- is
Pool Boolean - All addresses within this prefix are usable.
- last
Updated String - location
Id Number - Id of the location the object is scoped to (scope_type dcim.location).
- mark
Utilized Boolean - Report space as fully utilized.
- owner
Id Number - Id of the owner the object is assigned to.
- prefix String
- IPv4 or IPv6 network with mask, e.g. 10.0.0.0/24.
- prefix
Id Number - NetBox id.
- region
Id Number - Id of the region the object is scoped to (scope_type dcim.region).
- role
Id Number - Id of the role.
- scope
Id Number - Id of the scope object (see scope_type).
- scope
Type String - Content type of the scope. Derived from siteid, locationid, regionid or sitegroupid when one of those is set; set it together with scopeid otherwise. One of: dcim.site, dcim.location, dcim.region, dcim.sitegroup.
- site
Group NumberId - Id of the site group the object is scoped to (scope_type dcim.sitegroup).
- site
Id Number - Id of the site the object is scoped to (scope*type dcim.site). Conflicts with the other scope aliases and with setting the scope** pair directly.
- status String
- Operational status. One of: container, active, reserved, deprecated.
- List<String>
- Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
- List<String>
- Slugs of all tags on the object, including the provider's default_tags.
- tenant
Id Number - Id of the tenant.
- url String
- vlan
Id Number - Id of the VLAN.
- vrf
Id Number - Id of the VRF.
Import
In Terraform v1.5.0 and later, the import block can be used with the id attribute, for example:
terraform
import {
to = netbox_prefix.test
id = “123”
}
The pulumi import command can be used, for example:
$ pulumi import netbox:index/prefix:Prefix test 123
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- netbox e-breuninger/terraform-provider-netbox
- License
- Notes
- This Pulumi package is based on the
netboxTerraform Provider.
published on Wednesday, Nov 4, 2026 by e-breuninger