1. Registry
  2. Packages
  3. Netbox Provider
  4. API Docs
  5. Prefix
Viewing docs for netbox 6.0.1
published on Monday, Nov 16, 2026 by e-breuninger
netbox
Viewing docs for netbox 6.0.1
published on Monday, Nov 16, 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
    CustomFields 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
    IsPool bool
    All addresses within this prefix are usable.
    LocationId double
    Id of the location the object is scoped to (scope_type dcim.location).
    MarkUtilized bool
    Report space as fully utilized.
    OwnerId double
    Id of the owner the object is assigned to.
    RegionId double
    Id of the region the object is scoped to (scope_type dcim.region).
    RoleId double
    Id of the role.
    ScopeId double
    Id of the scope object (see scope_type).
    ScopeType 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.
    SiteGroupId double
    Id of the site group the object is scoped to (scope_type dcim.sitegroup).
    SiteId 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.
    Tags List<string>
    Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
    TenantId double
    Id of the tenant.
    VlanId double
    Id of the VLAN.
    VrfId double
    Id of the VRF.
    Prefix string
    IPv4 or IPv6 network with mask, e.g. 10.0.0.0/24.
    Comments string
    CustomFields 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
    IsPool bool
    All addresses within this prefix are usable.
    LocationId float64
    Id of the location the object is scoped to (scope_type dcim.location).
    MarkUtilized bool
    Report space as fully utilized.
    OwnerId float64
    Id of the owner the object is assigned to.
    RegionId float64
    Id of the region the object is scoped to (scope_type dcim.region).
    RoleId float64
    Id of the role.
    ScopeId float64
    Id of the scope object (see scope_type).
    ScopeType 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.
    SiteGroupId float64
    Id of the site group the object is scoped to (scope_type dcim.sitegroup).
    SiteId 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.
    Tags []string
    Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
    TenantId float64
    Id of the tenant.
    VlanId float64
    Id of the VLAN.
    VrfId 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_id number
    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.
    tags 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
    customFields 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
    isPool Boolean
    All addresses within this prefix are usable.
    locationId Double
    Id of the location the object is scoped to (scope_type dcim.location).
    markUtilized Boolean
    Report space as fully utilized.
    ownerId Double
    Id of the owner the object is assigned to.
    regionId Double
    Id of the region the object is scoped to (scope_type dcim.region).
    roleId Double
    Id of the role.
    scopeId Double
    Id of the scope object (see scope_type).
    scopeType 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.
    siteGroupId Double
    Id of the site group the object is scoped to (scope_type dcim.sitegroup).
    siteId 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.
    tags List<String>
    Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
    tenantId Double
    Id of the tenant.
    vlanId Double
    Id of the VLAN.
    vrfId Double
    Id of the VRF.
    prefix string
    IPv4 or IPv6 network with mask, e.g. 10.0.0.0/24.
    comments string
    customFields {[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
    isPool boolean
    All addresses within this prefix are usable.
    locationId number
    Id of the location the object is scoped to (scope_type dcim.location).
    markUtilized boolean
    Report space as fully utilized.
    ownerId number
    Id of the owner the object is assigned to.
    regionId number
    Id of the region the object is scoped to (scope_type dcim.region).
    roleId number
    Id of the role.
    scopeId number
    Id of the scope object (see scope_type).
    scopeType 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.
    siteGroupId number
    Id of the site group the object is scoped to (scope_type dcim.sitegroup).
    siteId 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.
    tags string[]
    Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
    tenantId number
    Id of the tenant.
    vlanId number
    Id of the VLAN.
    vrfId 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_id float
    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.
    tags 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
    customFields 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
    isPool Boolean
    All addresses within this prefix are usable.
    locationId Number
    Id of the location the object is scoped to (scope_type dcim.location).
    markUtilized Boolean
    Report space as fully utilized.
    ownerId Number
    Id of the owner the object is assigned to.
    regionId Number
    Id of the region the object is scoped to (scope_type dcim.region).
    roleId Number
    Id of the role.
    scopeId Number
    Id of the scope object (see scope_type).
    scopeType 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.
    siteGroupId Number
    Id of the site group the object is scoped to (scope_type dcim.sitegroup).
    siteId 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.
    tags List<String>
    Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
    tenantId Number
    Id of the tenant.
    vlanId Number
    Id of the VLAN.
    vrfId Number
    Id of the VRF.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Prefix resource produces the following output properties:

    Created string
    Family double
    Address family: 4 or 6.
    Id string
    The provider-assigned unique ID for this managed resource.
    LastUpdated string
    PrefixId double
    NetBox id.
    TagsAlls List<string>
    Slugs of all tags on the object, including the provider's default_tags.
    Url string
    Created string
    Family float64
    Address family: 4 or 6.
    Id string
    The provider-assigned unique ID for this managed resource.
    LastUpdated string
    PrefixId float64
    NetBox id.
    TagsAlls []string
    Slugs of all tags on the object, including the provider's default_tags.
    Url string
    created string
    family number
    Address family: 4 or 6.
    id string
    The provider-assigned unique ID for this managed resource.
    last_updated string
    prefix_id number
    NetBox id.
    tags_alls list(string)
    Slugs of all tags on the object, including the provider's default_tags.
    url string
    created String
    family Double
    Address family: 4 or 6.
    id String
    The provider-assigned unique ID for this managed resource.
    lastUpdated String
    prefixId Double
    NetBox id.
    tagsAlls List<String>
    Slugs of all tags on the object, including the provider's default_tags.
    url String
    created string
    family number
    Address family: 4 or 6.
    id string
    The provider-assigned unique ID for this managed resource.
    lastUpdated string
    prefixId number
    NetBox id.
    tagsAlls string[]
    Slugs of all tags on the object, including the provider's default_tags.
    url string
    created str
    family float
    Address family: 4 or 6.
    id str
    The provider-assigned unique ID for this managed resource.
    last_updated str
    prefix_id float
    NetBox id.
    tags_alls Sequence[str]
    Slugs of all tags on the object, including the provider's default_tags.
    url str
    created String
    family Number
    Address family: 4 or 6.
    id String
    The provider-assigned unique ID for this managed resource.
    lastUpdated String
    prefixId Number
    NetBox id.
    tagsAlls List<String>
    Slugs of all tags on the object, including the provider's default_tags.
    url String

    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) -> Prefix
    func 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:  existingPrefix:    type: netbox:Prefix    get:      id: ${id}
    import {
      to = netbox_prefix.example
      id = "${id}"
    }
    
    name string
    The unique name of the resulting resource.
    id Input<ID>
    The unique provider ID of the resource to look up.
    state PrefixState
    Known property values the provider needs, along with the ID, to find the resource. Usually not required.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resulting resource.
    id str
    The unique provider ID of the resource to look up.
    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 resulting resource.
    id IDInput
    The unique provider ID of the resource to look up.
    state PrefixState
    Known property values the provider needs, along with the ID, to find the resource. Usually not required.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resulting resource.
    id Input<string>
    The unique provider ID of the resource to look up.
    state PrefixState
    Known property values the provider needs, along with the ID, to find the resource. Usually not required.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resulting resource.
    id Output<String>
    The unique provider ID of the resource to look up.
    state PrefixState
    Known property values the provider needs, along with the ID, to find the resource. Usually not required.
    options CustomResourceOptions
    Bag of options to control resource's behavior.
    The following state arguments are supported:
    Comments string
    Created string
    CustomFields 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.
    IsPool bool
    All addresses within this prefix are usable.
    LastUpdated string
    LocationId double
    Id of the location the object is scoped to (scope_type dcim.location).
    MarkUtilized bool
    Report space as fully utilized.
    OwnerId 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.
    PrefixId double
    NetBox id.
    RegionId double
    Id of the region the object is scoped to (scope_type dcim.region).
    RoleId double
    Id of the role.
    ScopeId double
    Id of the scope object (see scope_type).
    ScopeType 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.
    SiteGroupId double
    Id of the site group the object is scoped to (scope_type dcim.sitegroup).
    SiteId 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.
    Tags List<string>
    Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
    TagsAlls List<string>
    Slugs of all tags on the object, including the provider's default_tags.
    TenantId double
    Id of the tenant.
    Url string
    VlanId double
    Id of the VLAN.
    VrfId double
    Id of the VRF.
    Comments string
    Created string
    CustomFields 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.
    IsPool bool
    All addresses within this prefix are usable.
    LastUpdated string
    LocationId float64
    Id of the location the object is scoped to (scope_type dcim.location).
    MarkUtilized bool
    Report space as fully utilized.
    OwnerId 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.
    PrefixId float64
    NetBox id.
    RegionId float64
    Id of the region the object is scoped to (scope_type dcim.region).
    RoleId float64
    Id of the role.
    ScopeId float64
    Id of the scope object (see scope_type).
    ScopeType 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.
    SiteGroupId float64
    Id of the site group the object is scoped to (scope_type dcim.sitegroup).
    SiteId 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.
    Tags []string
    Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
    TagsAlls []string
    Slugs of all tags on the object, including the provider's default_tags.
    TenantId float64
    Id of the tenant.
    Url string
    VlanId float64
    Id of the VLAN.
    VrfId 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_id number
    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.
    tags list(string)
    Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
    tags_alls 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
    customFields 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.
    isPool Boolean
    All addresses within this prefix are usable.
    lastUpdated String
    locationId Double
    Id of the location the object is scoped to (scope_type dcim.location).
    markUtilized Boolean
    Report space as fully utilized.
    ownerId 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.
    prefixId Double
    NetBox id.
    regionId Double
    Id of the region the object is scoped to (scope_type dcim.region).
    roleId Double
    Id of the role.
    scopeId Double
    Id of the scope object (see scope_type).
    scopeType 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.
    siteGroupId Double
    Id of the site group the object is scoped to (scope_type dcim.sitegroup).
    siteId 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.
    tags List<String>
    Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
    tagsAlls List<String>
    Slugs of all tags on the object, including the provider's default_tags.
    tenantId Double
    Id of the tenant.
    url String
    vlanId Double
    Id of the VLAN.
    vrfId Double
    Id of the VRF.
    comments string
    created string
    customFields {[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.
    isPool boolean
    All addresses within this prefix are usable.
    lastUpdated string
    locationId number
    Id of the location the object is scoped to (scope_type dcim.location).
    markUtilized boolean
    Report space as fully utilized.
    ownerId 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.
    prefixId number
    NetBox id.
    regionId number
    Id of the region the object is scoped to (scope_type dcim.region).
    roleId number
    Id of the role.
    scopeId number
    Id of the scope object (see scope_type).
    scopeType 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.
    siteGroupId number
    Id of the site group the object is scoped to (scope_type dcim.sitegroup).
    siteId 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.
    tags string[]
    Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
    tagsAlls string[]
    Slugs of all tags on the object, including the provider's default_tags.
    tenantId number
    Id of the tenant.
    url string
    vlanId number
    Id of the VLAN.
    vrfId 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_id float
    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.
    tags Sequence[str]
    Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
    tags_alls 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
    customFields 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.
    isPool Boolean
    All addresses within this prefix are usable.
    lastUpdated String
    locationId Number
    Id of the location the object is scoped to (scope_type dcim.location).
    markUtilized Boolean
    Report space as fully utilized.
    ownerId 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.
    prefixId Number
    NetBox id.
    regionId Number
    Id of the region the object is scoped to (scope_type dcim.region).
    roleId Number
    Id of the role.
    scopeId Number
    Id of the scope object (see scope_type).
    scopeType 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.
    siteGroupId Number
    Id of the site group the object is scoped to (scope_type dcim.sitegroup).
    siteId 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.
    tags List<String>
    Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
    tagsAlls List<String>
    Slugs of all tags on the object, including the provider's default_tags.
    tenantId Number
    Id of the tenant.
    url String
    vlanId Number
    Id of the VLAN.
    vrfId 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 netbox Terraform Provider.
    netbox
    Viewing docs for netbox 6.0.1
    published on Monday, Nov 16, 2026 by e-breuninger

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial