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",
],
});
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",
])
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
})
}
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",
},
});
});
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());
}
}
resources:
custAProd:
type: netbox:IpRange
properties:
endAddress: 10.0.0.50/24
startAddress: 10.0.0.1/24
tags:
- customer-a
- prod
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 string
- The unique name of the resource.
- args IpRangeArgs
- 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 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 string
- The unique name of the resource.
- args IpRangeArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args IpRangeArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args 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,
});
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),
})
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());
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)
const ipRangeResource = new netbox.IpRange("ipRangeResource", {
endAddress: "string",
startAddress: "string",
description: "string",
ipRangeId: "string",
roleId: 0,
status: "string",
tags: ["string"],
tenantId: 0,
vrfId: 0,
});
type: netbox:IpRange
properties:
description: string
endAddress: string
ipRangeId: string
roleId: 0
startAddress: string
status: string
tags:
- string
tenantId: 0
vrfId: 0
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:
- End
Address string - Start
Address string - Description string
- Ip
Range stringId - The ID of this resource.
- Role
Id double - Status string
- Valid values are
active
,reserved
anddeprecated
. Defaults toactive
. - List<string>
- Tenant
Id double - Vrf
Id double
- End
Address string - Start
Address string - Description string
- Ip
Range stringId - The ID of this resource.
- Role
Id float64 - Status string
- Valid values are
active
,reserved
anddeprecated
. Defaults toactive
. - []string
- Tenant
Id float64 - Vrf
Id float64
- end
Address String - start
Address String - description String
- ip
Range StringId - The ID of this resource.
- role
Id Double - status String
- Valid values are
active
,reserved
anddeprecated
. Defaults toactive
. - List<String>
- tenant
Id Double - vrf
Id Double
- end
Address string - start
Address string - description string
- ip
Range stringId - The ID of this resource.
- role
Id number - status string
- Valid values are
active
,reserved
anddeprecated
. Defaults toactive
. - string[]
- tenant
Id number - vrf
Id number
- end_
address str - start_
address str - description str
- ip_
range_ strid - The ID of this resource.
- role_
id float - status str
- Valid values are
active
,reserved
anddeprecated
. Defaults toactive
. - Sequence[str]
- tenant_
id float - vrf_
id float
- end
Address String - start
Address String - description String
- ip
Range StringId - The ID of this resource.
- role
Id Number - status String
- Valid values are
active
,reserved
anddeprecated
. Defaults toactive
. - List<String>
- tenant
Id Number - vrf
Id 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
- 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.
- Description string
- End
Address string - Ip
Range stringId - The ID of this resource.
- Role
Id double - Start
Address string - Status string
- Valid values are
active
,reserved
anddeprecated
. Defaults toactive
. - List<string>
- Tenant
Id double - Vrf
Id double
- Description string
- End
Address string - Ip
Range stringId - The ID of this resource.
- Role
Id float64 - Start
Address string - Status string
- Valid values are
active
,reserved
anddeprecated
. Defaults toactive
. - []string
- Tenant
Id float64 - Vrf
Id float64
- description String
- end
Address String - ip
Range StringId - The ID of this resource.
- role
Id Double - start
Address String - status String
- Valid values are
active
,reserved
anddeprecated
. Defaults toactive
. - List<String>
- tenant
Id Double - vrf
Id Double
- description string
- end
Address string - ip
Range stringId - The ID of this resource.
- role
Id number - start
Address string - status string
- Valid values are
active
,reserved
anddeprecated
. Defaults toactive
. - string[]
- tenant
Id number - vrf
Id number
- description str
- end_
address str - ip_
range_ strid - The ID of this resource.
- role_
id float - start_
address str - status str
- Valid values are
active
,reserved
anddeprecated
. Defaults toactive
. - Sequence[str]
- tenant_
id float - vrf_
id float
- description String
- end
Address String - ip
Range StringId - The ID of this resource.
- role
Id Number - start
Address String - status String
- Valid values are
active
,reserved
anddeprecated
. Defaults toactive
. - List<String>
- tenant
Id Number - vrf
Id Number
Package Details
- Repository
- netbox e-breuninger/terraform-provider-netbox
- License
- Notes
- This Pulumi package is based on the
netbox
Terraform Provider.