1. Registry
  2. Packages
  3. Netbox Provider
  4. API Docs
  5. ConsoleServerPortTemplate
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 server port that will be created on all instantiations of the parent device type. See the console server 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: "Opengear"});
    const testDeviceType = new netbox.DeviceType("test", {
        model: "CM8148",
        slug: "cm8148",
        partNumber: "CM8148",
        manufacturerId: test.manufacturerId,
    });
    const testConsoleServerPortTemplate = new netbox.ConsoleServerPortTemplate("test", {
        name: "port1",
        description: "Console server port 1",
        label: "Port 1",
        deviceTypeId: testDeviceType.deviceTypeId,
        type: "rj-45",
    });
    
    import pulumi
    import pulumi_netbox as netbox
    
    test = netbox.Manufacturer("test", name="Opengear")
    test_device_type = netbox.DeviceType("test",
        model="CM8148",
        slug="cm8148",
        part_number="CM8148",
        manufacturer_id=test.manufacturer_id)
    test_console_server_port_template = netbox.ConsoleServerPortTemplate("test",
        name="port1",
        description="Console server port 1",
        label="Port 1",
        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("Opengear"),
    		})
    		if err != nil {
    			return err
    		}
    		testDeviceType, err := netbox.NewDeviceType(ctx, "test", &netbox.DeviceTypeArgs{
    			Model:          pulumi.String("CM8148"),
    			Slug:           pulumi.String("cm8148"),
    			PartNumber:     pulumi.String("CM8148"),
    			ManufacturerId: test.ManufacturerId,
    		})
    		if err != nil {
    			return err
    		}
    		_, err = netbox.NewConsoleServerPortTemplate(ctx, "test", &netbox.ConsoleServerPortTemplateArgs{
    			Name:         pulumi.String("port1"),
    			Description:  pulumi.String("Console server port 1"),
    			Label:        pulumi.String("Port 1"),
    			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 = "Opengear",
        });
    
        var testDeviceType = new Netbox.DeviceType("test", new()
        {
            Model = "CM8148",
            Slug = "cm8148",
            PartNumber = "CM8148",
            ManufacturerId = test.ManufacturerId,
        });
    
        var testConsoleServerPortTemplate = new Netbox.ConsoleServerPortTemplate("test", new()
        {
            Name = "port1",
            Description = "Console server port 1",
            Label = "Port 1",
            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.ConsoleServerPortTemplate;
    import com.pulumi.netbox.ConsoleServerPortTemplateArgs;
    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("Opengear")
                .build());
    
            var testDeviceType = new DeviceType("testDeviceType", DeviceTypeArgs.builder()
                .model("CM8148")
                .slug("cm8148")
                .partNumber("CM8148")
                .manufacturerId(test.manufacturerId())
                .build());
    
            var testConsoleServerPortTemplate = new ConsoleServerPortTemplate("testConsoleServerPortTemplate", ConsoleServerPortTemplateArgs.builder()
                .name("port1")
                .description("Console server port 1")
                .label("Port 1")
                .deviceTypeId(testDeviceType.deviceTypeId())
                .type("rj-45")
                .build());
    
        }
    }
    
    resources:
      test:
        type: netbox:Manufacturer
        properties:
          name: Opengear
      testDeviceType:
        type: netbox:DeviceType
        name: test
        properties:
          model: CM8148
          slug: cm8148
          partNumber: CM8148
          manufacturerId: ${test.manufacturerId}
      testConsoleServerPortTemplate:
        type: netbox:ConsoleServerPortTemplate
        name: test
        properties:
          name: port1
          description: Console server port 1
          label: Port 1
          deviceTypeId: ${testDeviceType.deviceTypeId}
          type: rj-45
    
    Example coming soon!
    

    Create ConsoleServerPortTemplate Resource

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

    Constructor syntax

    new ConsoleServerPortTemplate(name: string, args?: ConsoleServerPortTemplateArgs, opts?: CustomResourceOptions);
    @overload
    def ConsoleServerPortTemplate(resource_name: str,
                                  args: Optional[ConsoleServerPortTemplateArgs] = None,
                                  opts: Optional[ResourceOptions] = None)
    
    @overload
    def ConsoleServerPortTemplate(resource_name: str,
                                  opts: Optional[ResourceOptions] = None,
                                  console_server_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 NewConsoleServerPortTemplate(ctx *Context, name string, args *ConsoleServerPortTemplateArgs, opts ...ResourceOption) (*ConsoleServerPortTemplate, error)
    public ConsoleServerPortTemplate(string name, ConsoleServerPortTemplateArgs? args = null, CustomResourceOptions? opts = null)
    public ConsoleServerPortTemplate(String name, ConsoleServerPortTemplateArgs args)
    public ConsoleServerPortTemplate(String name, ConsoleServerPortTemplateArgs args, CustomResourceOptions options)
    
    type: netbox:ConsoleServerPortTemplate
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "netbox_console_server_port_template" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args ConsoleServerPortTemplateArgs
    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 ConsoleServerPortTemplateArgs
    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 ConsoleServerPortTemplateArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ConsoleServerPortTemplateArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ConsoleServerPortTemplateArgs
    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 consoleServerPortTemplateResource = new Netbox.ConsoleServerPortTemplate("consoleServerPortTemplateResource", new()
    {
        ConsoleServerPortTemplateId = "string",
        Description = "string",
        DeviceTypeId = 0.0,
        Label = "string",
        ModuleTypeId = 0.0,
        Name = "string",
        Type = "string",
    });
    
    example, err := netbox.NewConsoleServerPortTemplate(ctx, "consoleServerPortTemplateResource", &netbox.ConsoleServerPortTemplateArgs{
    	ConsoleServerPortTemplateId: 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_server_port_template" "consoleServerPortTemplateResource" {
      lifecycle {
        create_before_destroy = true
      }
      console_server_port_template_id = "string"
      description                     = "string"
      device_type_id                  = 0
      label                           = "string"
      module_type_id                  = 0
      name                            = "string"
      type                            = "string"
    }
    
    var consoleServerPortTemplateResource = new ConsoleServerPortTemplate("consoleServerPortTemplateResource", ConsoleServerPortTemplateArgs.builder()
        .consoleServerPortTemplateId("string")
        .description("string")
        .deviceTypeId(0.0)
        .label("string")
        .moduleTypeId(0.0)
        .name("string")
        .type("string")
        .build());
    
    console_server_port_template_resource = netbox.ConsoleServerPortTemplate("consoleServerPortTemplateResource",
        console_server_port_template_id="string",
        description="string",
        device_type_id=float(0),
        label="string",
        module_type_id=float(0),
        name="string",
        type="string")
    
    const consoleServerPortTemplateResource = new netbox.ConsoleServerPortTemplate("consoleServerPortTemplateResource", {
        consoleServerPortTemplateId: "string",
        description: "string",
        deviceTypeId: 0,
        label: "string",
        moduleTypeId: 0,
        name: "string",
        type: "string",
    });
    
    type: netbox:ConsoleServerPortTemplate
    properties:
        consoleServerPortTemplateId: string
        description: string
        deviceTypeId: 0
        label: string
        moduleTypeId: 0
        name: string
        type: string
    

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

    ConsoleServerPortTemplateId 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].
    ConsoleServerPortTemplateId 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_server_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].
    consoleServerPortTemplateId 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].
    consoleServerPortTemplateId 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_server_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].
    consoleServerPortTemplateId 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 ConsoleServerPortTemplate 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 ConsoleServerPortTemplate Resource

    Get an existing ConsoleServerPortTemplate 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?: ConsoleServerPortTemplateState, opts?: CustomResourceOptions): ConsoleServerPortTemplate
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            console_server_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) -> ConsoleServerPortTemplate
    func GetConsoleServerPortTemplate(ctx *Context, name string, id IDInput, state *ConsoleServerPortTemplateState, opts ...ResourceOption) (*ConsoleServerPortTemplate, error)
    public static ConsoleServerPortTemplate Get(string name, Input<string> id, ConsoleServerPortTemplateState? state, CustomResourceOptions? opts = null)
    public static ConsoleServerPortTemplate get(String name, Output<String> id, ConsoleServerPortTemplateState state, CustomResourceOptions options)
    resources:  _:    type: netbox:ConsoleServerPortTemplate    get:      id: ${id}
    import {
      to = netbox_console_server_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:
    ConsoleServerPortTemplateId 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].
    ConsoleServerPortTemplateId 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_server_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].
    consoleServerPortTemplateId 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].
    consoleServerPortTemplateId 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_server_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].
    consoleServerPortTemplateId 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