1. Packages
  2. Netbox Provider
  3. API Docs
  4. IpRange
netbox 3.10.0 published on Monday, Apr 14, 2025 by e-breuninger

netbox.IpRange

Explore with Pulumi AI

From the official documentation:

This model represents an arbitrary range of individual IPv4 or IPv6 addresses, inclusive of its starting and ending addresses. For instance, the range 192.0.2.10 to 192.0.2.20 has eleven members. (The total member count is available as the size property on an IPRange instance.) Like prefixes and IP addresses, each IP range may optionally be assigned to a VRF and/or tenant.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as netbox from "@pulumi/netbox";

const custAProd = new netbox.IpRange("custAProd", {
    endAddress: "10.0.0.50/24",
    startAddress: "10.0.0.1/24",
    tags: [
        "customer-a",
        "prod",
    ],
});
Copy
import pulumi
import pulumi_netbox as netbox

cust_a_prod = netbox.IpRange("custAProd",
    end_address="10.0.0.50/24",
    start_address="10.0.0.1/24",
    tags=[
        "customer-a",
        "prod",
    ])
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/netbox/v3/netbox"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := netbox.NewIpRange(ctx, "custAProd", &netbox.IpRangeArgs{
			EndAddress:   pulumi.String("10.0.0.50/24"),
			StartAddress: pulumi.String("10.0.0.1/24"),
			Tags: pulumi.StringArray{
				pulumi.String("customer-a"),
				pulumi.String("prod"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Netbox = Pulumi.Netbox;

return await Deployment.RunAsync(() => 
{
    var custAProd = new Netbox.IpRange("custAProd", new()
    {
        EndAddress = "10.0.0.50/24",
        StartAddress = "10.0.0.1/24",
        Tags = new[]
        {
            "customer-a",
            "prod",
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.netbox.IpRange;
import com.pulumi.netbox.IpRangeArgs;
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 custAProd = new IpRange("custAProd", IpRangeArgs.builder()
            .endAddress("10.0.0.50/24")
            .startAddress("10.0.0.1/24")
            .tags(            
                "customer-a",
                "prod")
            .build());

    }
}
Copy
resources:
  custAProd:
    type: netbox:IpRange
    properties:
      endAddress: 10.0.0.50/24
      startAddress: 10.0.0.1/24
      tags:
        - customer-a
        - prod
Copy

Create IpRange Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new IpRange(name: string, args: IpRangeArgs, opts?: CustomResourceOptions);
@overload
def IpRange(resource_name: str,
            args: IpRangeArgs,
            opts: Optional[ResourceOptions] = None)

@overload
def IpRange(resource_name: str,
            opts: Optional[ResourceOptions] = None,
            end_address: Optional[str] = None,
            start_address: Optional[str] = None,
            description: Optional[str] = None,
            ip_range_id: Optional[str] = None,
            role_id: Optional[float] = None,
            status: Optional[str] = None,
            tags: Optional[Sequence[str]] = None,
            tenant_id: Optional[float] = None,
            vrf_id: Optional[float] = None)
func NewIpRange(ctx *Context, name string, args IpRangeArgs, opts ...ResourceOption) (*IpRange, error)
public IpRange(string name, IpRangeArgs args, CustomResourceOptions? opts = null)
public IpRange(String name, IpRangeArgs args)
public IpRange(String name, IpRangeArgs args, CustomResourceOptions options)
type: netbox:IpRange
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. IpRangeArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. IpRangeArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. IpRangeArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. IpRangeArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. IpRangeArgs
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 ipRangeResource = new Netbox.IpRange("ipRangeResource", new()
{
    EndAddress = "string",
    StartAddress = "string",
    Description = "string",
    IpRangeId = "string",
    RoleId = 0,
    Status = "string",
    Tags = new[]
    {
        "string",
    },
    TenantId = 0,
    VrfId = 0,
});
Copy
example, err := netbox.NewIpRange(ctx, "ipRangeResource", &netbox.IpRangeArgs{
	EndAddress:   pulumi.String("string"),
	StartAddress: pulumi.String("string"),
	Description:  pulumi.String("string"),
	IpRangeId:    pulumi.String("string"),
	RoleId:       pulumi.Float64(0),
	Status:       pulumi.String("string"),
	Tags: pulumi.StringArray{
		pulumi.String("string"),
	},
	TenantId: pulumi.Float64(0),
	VrfId:    pulumi.Float64(0),
})
Copy
var ipRangeResource = new IpRange("ipRangeResource", IpRangeArgs.builder()
    .endAddress("string")
    .startAddress("string")
    .description("string")
    .ipRangeId("string")
    .roleId(0)
    .status("string")
    .tags("string")
    .tenantId(0)
    .vrfId(0)
    .build());
Copy
ip_range_resource = netbox.IpRange("ipRangeResource",
    end_address="string",
    start_address="string",
    description="string",
    ip_range_id="string",
    role_id=0,
    status="string",
    tags=["string"],
    tenant_id=0,
    vrf_id=0)
Copy
const ipRangeResource = new netbox.IpRange("ipRangeResource", {
    endAddress: "string",
    startAddress: "string",
    description: "string",
    ipRangeId: "string",
    roleId: 0,
    status: "string",
    tags: ["string"],
    tenantId: 0,
    vrfId: 0,
});
Copy
type: netbox:IpRange
properties:
    description: string
    endAddress: string
    ipRangeId: string
    roleId: 0
    startAddress: string
    status: string
    tags:
        - string
    tenantId: 0
    vrfId: 0
Copy

IpRange 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 IpRange resource accepts the following input properties:

EndAddress This property is required. string
StartAddress This property is required. string
Description string
IpRangeId string
The ID of this resource.
RoleId double
Status string
Valid values are active, reserved and deprecated. Defaults to active.
Tags List<string>
TenantId double
VrfId double
EndAddress This property is required. string
StartAddress This property is required. string
Description string
IpRangeId string
The ID of this resource.
RoleId float64
Status string
Valid values are active, reserved and deprecated. Defaults to active.
Tags []string
TenantId float64
VrfId float64
endAddress This property is required. String
startAddress This property is required. String
description String
ipRangeId String
The ID of this resource.
roleId Double
status String
Valid values are active, reserved and deprecated. Defaults to active.
tags List<String>
tenantId Double
vrfId Double
endAddress This property is required. string
startAddress This property is required. string
description string
ipRangeId string
The ID of this resource.
roleId number
status string
Valid values are active, reserved and deprecated. Defaults to active.
tags string[]
tenantId number
vrfId number
end_address This property is required. str
start_address This property is required. str
description str
ip_range_id str
The ID of this resource.
role_id float
status str
Valid values are active, reserved and deprecated. Defaults to active.
tags Sequence[str]
tenant_id float
vrf_id float
endAddress This property is required. String
startAddress This property is required. String
description String
ipRangeId String
The ID of this resource.
roleId Number
status String
Valid values are active, reserved and deprecated. Defaults to active.
tags List<String>
tenantId Number
vrfId Number

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing IpRange Resource

Get an existing IpRange 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?: IpRangeState, opts?: CustomResourceOptions): IpRange
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        description: Optional[str] = None,
        end_address: Optional[str] = None,
        ip_range_id: Optional[str] = None,
        role_id: Optional[float] = None,
        start_address: Optional[str] = None,
        status: Optional[str] = None,
        tags: Optional[Sequence[str]] = None,
        tenant_id: Optional[float] = None,
        vrf_id: Optional[float] = None) -> IpRange
func GetIpRange(ctx *Context, name string, id IDInput, state *IpRangeState, opts ...ResourceOption) (*IpRange, error)
public static IpRange Get(string name, Input<string> id, IpRangeState? state, CustomResourceOptions? opts = null)
public static IpRange get(String name, Output<String> id, IpRangeState state, CustomResourceOptions options)
resources:  _:    type: netbox:IpRange    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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.
The following state arguments are supported:
Description string
EndAddress string
IpRangeId string
The ID of this resource.
RoleId double
StartAddress string
Status string
Valid values are active, reserved and deprecated. Defaults to active.
Tags List<string>
TenantId double
VrfId double
Description string
EndAddress string
IpRangeId string
The ID of this resource.
RoleId float64
StartAddress string
Status string
Valid values are active, reserved and deprecated. Defaults to active.
Tags []string
TenantId float64
VrfId float64
description String
endAddress String
ipRangeId String
The ID of this resource.
roleId Double
startAddress String
status String
Valid values are active, reserved and deprecated. Defaults to active.
tags List<String>
tenantId Double
vrfId Double
description string
endAddress string
ipRangeId string
The ID of this resource.
roleId number
startAddress string
status string
Valid values are active, reserved and deprecated. Defaults to active.
tags string[]
tenantId number
vrfId number
description str
end_address str
ip_range_id str
The ID of this resource.
role_id float
start_address str
status str
Valid values are active, reserved and deprecated. Defaults to active.
tags Sequence[str]
tenant_id float
vrf_id float
description String
endAddress String
ipRangeId String
The ID of this resource.
roleId Number
startAddress String
status String
Valid values are active, reserved and deprecated. Defaults to active.
tags List<String>
tenantId Number
vrfId Number

Package Details

Repository
netbox e-breuninger/terraform-provider-netbox
License
Notes
This Pulumi package is based on the netbox Terraform Provider.