1. Registry
  2. Packages
  3. Netbox Provider
  4. API Docs
  5. ConsolePortTemplate
Viewing docs for netbox 5.8.0
published on Friday, Sep 4, 2026 by e-breuninger
Viewing docs for netbox 5.8.0
published on Friday, Sep 4, 2026 by e-breuninger

    From the official documentation:

    A template for a console port that will be created on all instantiations of the parent device type. See the console port documentation for more detail.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as netbox from "@pulumi/netbox";
    
    const test = new netbox.Manufacturer("test", {name: "Dell"});
    const testDeviceType = new netbox.DeviceType("test", {
        model: "PowerSwitch S4112F-ON",
        slug: "powerswitch-s4112f-on",
        partNumber: "S4112F-ON",
        manufacturerId: test.manufacturerId,
    });
    const testConsolePortTemplate = new netbox.ConsolePortTemplate("test", {
        name: "console",
        description: "RJ-45 serial console port",
        label: "Serial console",
        deviceTypeId: testDeviceType.deviceTypeId,
        type: "rj-45",
    });
    
    import pulumi
    import pulumi_netbox as netbox
    
    test = netbox.Manufacturer("test", name="Dell")
    test_device_type = netbox.DeviceType("test",
        model="PowerSwitch S4112F-ON",
        slug="powerswitch-s4112f-on",
        part_number="S4112F-ON",
        manufacturer_id=test.manufacturer_id)
    test_console_port_template = netbox.ConsolePortTemplate("test",
        name="console",
        description="RJ-45 serial console port",
        label="Serial console",
        device_type_id=test_device_type.device_type_id,
        type="rj-45")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/netbox/v5/netbox"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		test, err := netbox.NewManufacturer(ctx, "test", &netbox.ManufacturerArgs{
    			Name: pulumi.String("Dell"),
    		})
    		if err != nil {
    			return err
    		}
    		testDeviceType, err := netbox.NewDeviceType(ctx, "test", &netbox.DeviceTypeArgs{
    			Model:          pulumi.String("PowerSwitch S4112F-ON"),
    			Slug:           pulumi.String("powerswitch-s4112f-on"),
    			PartNumber:     pulumi.String("S4112F-ON"),
    			ManufacturerId: test.ManufacturerId,
    		})
    		if err != nil {
    			return err
    		}
    		_, err = netbox.NewConsolePortTemplate(ctx, "test", &netbox.ConsolePortTemplateArgs{
    			Name:         pulumi.String("console"),
    			Description:  pulumi.String("RJ-45 serial console port"),
    			Label:        pulumi.String("Serial console"),
    			DeviceTypeId: testDeviceType.DeviceTypeId,
    			Type:         pulumi.String("rj-45"),
    		})
    		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.Manufacturer("test", new()
        {
            Name = "Dell",
        });
    
        var testDeviceType = new Netbox.DeviceType("test", new()
        {
            Model = "PowerSwitch S4112F-ON",
            Slug = "powerswitch-s4112f-on",
            PartNumber = "S4112F-ON",
            ManufacturerId = test.ManufacturerId,
        });
    
        var testConsolePortTemplate = new Netbox.ConsolePortTemplate("test", new()
        {
            Name = "console",
            Description = "RJ-45 serial console port",
            Label = "Serial console",
            DeviceTypeId = testDeviceType.DeviceTypeId,
            Type = "rj-45",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.netbox.Manufacturer;
    import com.pulumi.netbox.ManufacturerArgs;
    import com.pulumi.netbox.DeviceType;
    import com.pulumi.netbox.DeviceTypeArgs;
    import com.pulumi.netbox.ConsolePortTemplate;
    import com.pulumi.netbox.ConsolePortTemplateArgs;
    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 Manufacturer("test", ManufacturerArgs.builder()
                .name("Dell")
                .build());
    
            var testDeviceType = new DeviceType("testDeviceType", DeviceTypeArgs.builder()
                .model("PowerSwitch S4112F-ON")
                .slug("powerswitch-s4112f-on")
                .partNumber("S4112F-ON")
                .manufacturerId(test.manufacturerId())
                .build());
    
            var testConsolePortTemplate = new ConsolePortTemplate("testConsolePortTemplate", ConsolePortTemplateArgs.builder()
                .name("console")
                .description("RJ-45 serial console port")
                .label("Serial console")
                .deviceTypeId(testDeviceType.deviceTypeId())
                .type("rj-45")
                .build());
    
        }
    }
    
    resources:
      test:
        type: netbox:Manufacturer
        properties:
          name: Dell
      testDeviceType:
        type: netbox:DeviceType
        name: test
        properties:
          model: PowerSwitch S4112F-ON
          slug: powerswitch-s4112f-on
          partNumber: S4112F-ON
          manufacturerId: ${test.manufacturerId}
      testConsolePortTemplate:
        type: netbox:ConsolePortTemplate
        name: test
        properties:
          name: console
          description: RJ-45 serial console port
          label: Serial console
          deviceTypeId: ${testDeviceType.deviceTypeId}
          type: rj-45
    
    Example coming soon!
    

    Create ConsolePortTemplate Resource

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

    Constructor syntax

    new ConsolePortTemplate(name: string, args?: ConsolePortTemplateArgs, opts?: CustomResourceOptions);
    @overload
    def ConsolePortTemplate(resource_name: str,
                            args: Optional[ConsolePortTemplateArgs] = None,
                            opts: Optional[ResourceOptions] = None)
    
    @overload
    def ConsolePortTemplate(resource_name: str,
                            opts: Optional[ResourceOptions] = None,
                            console_port_template_id: Optional[str] = None,
                            description: Optional[str] = None,
                            device_type_id: Optional[float] = None,
                            label: Optional[str] = None,
                            module_type_id: Optional[float] = None,
                            name: Optional[str] = None,
                            type: Optional[str] = None)
    func NewConsolePortTemplate(ctx *Context, name string, args *ConsolePortTemplateArgs, opts ...ResourceOption) (*ConsolePortTemplate, error)
    public ConsolePortTemplate(string name, ConsolePortTemplateArgs? args = null, CustomResourceOptions? opts = null)
    public ConsolePortTemplate(String name, ConsolePortTemplateArgs args)
    public ConsolePortTemplate(String name, ConsolePortTemplateArgs args, CustomResourceOptions options)
    
    type: netbox:ConsolePortTemplate
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "netbox_console_port_template" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args ConsolePortTemplateArgs
    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 ConsolePortTemplateArgs
    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 ConsolePortTemplateArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ConsolePortTemplateArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ConsolePortTemplateArgs
    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 consolePortTemplateResource = new Netbox.ConsolePortTemplate("consolePortTemplateResource", new()
    {
        ConsolePortTemplateId = "string",
        Description = "string",
        DeviceTypeId = 0.0,
        Label = "string",
        ModuleTypeId = 0.0,
        Name = "string",
        Type = "string",
    });
    
    example, err := netbox.NewConsolePortTemplate(ctx, "consolePortTemplateResource", &netbox.ConsolePortTemplateArgs{
    	ConsolePortTemplateId: pulumi.String("string"),
    	Description:           pulumi.String("string"),
    	DeviceTypeId:          pulumi.Float64(0),
    	Label:                 pulumi.String("string"),
    	ModuleTypeId:          pulumi.Float64(0),
    	Name:                  pulumi.String("string"),
    	Type:                  pulumi.String("string"),
    })
    
    resource "netbox_console_port_template" "consolePortTemplateResource" {
      lifecycle {
        create_before_destroy = true
      }
      console_port_template_id = "string"
      description              = "string"
      device_type_id           = 0
      label                    = "string"
      module_type_id           = 0
      name                     = "string"
      type                     = "string"
    }
    
    var consolePortTemplateResource = new ConsolePortTemplate("consolePortTemplateResource", ConsolePortTemplateArgs.builder()
        .consolePortTemplateId("string")
        .description("string")
        .deviceTypeId(0.0)
        .label("string")
        .moduleTypeId(0.0)
        .name("string")
        .type("string")
        .build());
    
    console_port_template_resource = netbox.ConsolePortTemplate("consolePortTemplateResource",
        console_port_template_id="string",
        description="string",
        device_type_id=float(0),
        label="string",
        module_type_id=float(0),
        name="string",
        type="string")
    
    const consolePortTemplateResource = new netbox.ConsolePortTemplate("consolePortTemplateResource", {
        consolePortTemplateId: "string",
        description: "string",
        deviceTypeId: 0,
        label: "string",
        moduleTypeId: 0,
        name: "string",
        type: "string",
    });
    
    type: netbox:ConsolePortTemplate
    properties:
        consolePortTemplateId: string
        description: string
        deviceTypeId: 0
        label: string
        moduleTypeId: 0
        name: string
        type: string
    

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

    ConsolePortTemplateId string
    The ID of this resource.
    Description string
    DeviceTypeId double
    Exactly one of device_type_id or module_type_id must be given.
    Label string
    ModuleTypeId double
    Exactly one of device_type_id or module_type_id must be given.
    Name string
    Type string
    One of [de-9, db-25, rj-11, rj-12, rj-45, mini-din-8, usb-a, usb-b, usb-c, usb-mini-a, usb-mini-b, usb-micro-a, usb-micro-b, usb-micro-ab, other].
    ConsolePortTemplateId string
    The ID of this resource.
    Description string
    DeviceTypeId float64
    Exactly one of device_type_id or module_type_id must be given.
    Label string
    ModuleTypeId float64
    Exactly one of device_type_id or module_type_id must be given.
    Name string
    Type string
    One of [de-9, db-25, rj-11, rj-12, rj-45, mini-din-8, usb-a, usb-b, usb-c, usb-mini-a, usb-mini-b, usb-micro-a, usb-micro-b, usb-micro-ab, other].
    console_port_template_id string
    The ID of this resource.
    description string
    device_type_id number
    Exactly one of device_type_id or module_type_id must be given.
    label string
    module_type_id number
    Exactly one of device_type_id or module_type_id must be given.
    name string
    type string
    One of [de-9, db-25, rj-11, rj-12, rj-45, mini-din-8, usb-a, usb-b, usb-c, usb-mini-a, usb-mini-b, usb-micro-a, usb-micro-b, usb-micro-ab, other].
    consolePortTemplateId String
    The ID of this resource.
    description String
    deviceTypeId Double
    Exactly one of device_type_id or module_type_id must be given.
    label String
    moduleTypeId Double
    Exactly one of device_type_id or module_type_id must be given.
    name String
    type String
    One of [de-9, db-25, rj-11, rj-12, rj-45, mini-din-8, usb-a, usb-b, usb-c, usb-mini-a, usb-mini-b, usb-micro-a, usb-micro-b, usb-micro-ab, other].
    consolePortTemplateId string
    The ID of this resource.
    description string
    deviceTypeId number
    Exactly one of device_type_id or module_type_id must be given.
    label string
    moduleTypeId number
    Exactly one of device_type_id or module_type_id must be given.
    name string
    type string
    One of [de-9, db-25, rj-11, rj-12, rj-45, mini-din-8, usb-a, usb-b, usb-c, usb-mini-a, usb-mini-b, usb-micro-a, usb-micro-b, usb-micro-ab, other].
    console_port_template_id str
    The ID of this resource.
    description str
    device_type_id float
    Exactly one of device_type_id or module_type_id must be given.
    label str
    module_type_id float
    Exactly one of device_type_id or module_type_id must be given.
    name str
    type str
    One of [de-9, db-25, rj-11, rj-12, rj-45, mini-din-8, usb-a, usb-b, usb-c, usb-mini-a, usb-mini-b, usb-micro-a, usb-micro-b, usb-micro-ab, other].
    consolePortTemplateId String
    The ID of this resource.
    description String
    deviceTypeId Number
    Exactly one of device_type_id or module_type_id must be given.
    label String
    moduleTypeId Number
    Exactly one of device_type_id or module_type_id must be given.
    name String
    type String
    One of [de-9, db-25, rj-11, rj-12, rj-45, mini-din-8, usb-a, usb-b, usb-c, usb-mini-a, usb-mini-b, usb-micro-a, usb-micro-b, usb-micro-ab, other].

    Outputs

    All input properties are implicitly available as output properties. Additionally, the ConsolePortTemplate 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 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 ConsolePortTemplate Resource

    Get an existing ConsolePortTemplate 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?: ConsolePortTemplateState, opts?: CustomResourceOptions): ConsolePortTemplate
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            console_port_template_id: Optional[str] = None,
            description: Optional[str] = None,
            device_type_id: Optional[float] = None,
            label: Optional[str] = None,
            module_type_id: Optional[float] = None,
            name: Optional[str] = None,
            type: Optional[str] = None) -> ConsolePortTemplate
    func GetConsolePortTemplate(ctx *Context, name string, id IDInput, state *ConsolePortTemplateState, opts ...ResourceOption) (*ConsolePortTemplate, error)
    public static ConsolePortTemplate Get(string name, Input<string> id, ConsolePortTemplateState? state, CustomResourceOptions? opts = null)
    public static ConsolePortTemplate get(String name, Output<String> id, ConsolePortTemplateState state, CustomResourceOptions options)
    resources:  _:    type: netbox:ConsolePortTemplate    get:      id: ${id}
    import {
      to = netbox_console_port_template.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.
    The following state arguments are supported:
    ConsolePortTemplateId string
    The ID of this resource.
    Description string
    DeviceTypeId double
    Exactly one of device_type_id or module_type_id must be given.
    Label string
    ModuleTypeId double
    Exactly one of device_type_id or module_type_id must be given.
    Name string
    Type string
    One of [de-9, db-25, rj-11, rj-12, rj-45, mini-din-8, usb-a, usb-b, usb-c, usb-mini-a, usb-mini-b, usb-micro-a, usb-micro-b, usb-micro-ab, other].
    ConsolePortTemplateId string
    The ID of this resource.
    Description string
    DeviceTypeId float64
    Exactly one of device_type_id or module_type_id must be given.
    Label string
    ModuleTypeId float64
    Exactly one of device_type_id or module_type_id must be given.
    Name string
    Type string
    One of [de-9, db-25, rj-11, rj-12, rj-45, mini-din-8, usb-a, usb-b, usb-c, usb-mini-a, usb-mini-b, usb-micro-a, usb-micro-b, usb-micro-ab, other].
    console_port_template_id string
    The ID of this resource.
    description string
    device_type_id number
    Exactly one of device_type_id or module_type_id must be given.
    label string
    module_type_id number
    Exactly one of device_type_id or module_type_id must be given.
    name string
    type string
    One of [de-9, db-25, rj-11, rj-12, rj-45, mini-din-8, usb-a, usb-b, usb-c, usb-mini-a, usb-mini-b, usb-micro-a, usb-micro-b, usb-micro-ab, other].
    consolePortTemplateId String
    The ID of this resource.
    description String
    deviceTypeId Double
    Exactly one of device_type_id or module_type_id must be given.
    label String
    moduleTypeId Double
    Exactly one of device_type_id or module_type_id must be given.
    name String
    type String
    One of [de-9, db-25, rj-11, rj-12, rj-45, mini-din-8, usb-a, usb-b, usb-c, usb-mini-a, usb-mini-b, usb-micro-a, usb-micro-b, usb-micro-ab, other].
    consolePortTemplateId string
    The ID of this resource.
    description string
    deviceTypeId number
    Exactly one of device_type_id or module_type_id must be given.
    label string
    moduleTypeId number
    Exactly one of device_type_id or module_type_id must be given.
    name string
    type string
    One of [de-9, db-25, rj-11, rj-12, rj-45, mini-din-8, usb-a, usb-b, usb-c, usb-mini-a, usb-mini-b, usb-micro-a, usb-micro-b, usb-micro-ab, other].
    console_port_template_id str
    The ID of this resource.
    description str
    device_type_id float
    Exactly one of device_type_id or module_type_id must be given.
    label str
    module_type_id float
    Exactly one of device_type_id or module_type_id must be given.
    name str
    type str
    One of [de-9, db-25, rj-11, rj-12, rj-45, mini-din-8, usb-a, usb-b, usb-c, usb-mini-a, usb-mini-b, usb-micro-a, usb-micro-b, usb-micro-ab, other].
    consolePortTemplateId String
    The ID of this resource.
    description String
    deviceTypeId Number
    Exactly one of device_type_id or module_type_id must be given.
    label String
    moduleTypeId Number
    Exactly one of device_type_id or module_type_id must be given.
    name String
    type String
    One of [de-9, db-25, rj-11, rj-12, rj-45, mini-din-8, usb-a, usb-b, usb-c, usb-mini-a, usb-mini-b, usb-micro-a, usb-micro-b, usb-micro-ab, other].

    Package Details

    Repository
    netbox e-breuninger/terraform-provider-netbox
    License
    Notes
    This Pulumi package is based on the netbox Terraform Provider.
    Viewing docs for netbox 5.8.0
    published on Friday, Sep 4, 2026 by e-breuninger

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial