1. Registry
  2. Packages
  3. Netbox Provider
  4. API Docs
  5. ServiceTemplate
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 service template: a named protocol and port set that services can be created from (ipam.servicetemplate).

    From the official documentation:

    Application service templates can be used to instantiate application services on devices and virtual machines.

    Changed in NetBox v4.4: Previously, application service templates were referred to simply as “service templates”. The name has been changed in the UI to better reflect their intended use. There is no change to the name of the model or in any programmatic NetBox APIs.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as netbox from "@pulumi/netbox";
    
    const test = new netbox.ServiceTemplate("test", {
        name: "test-service-template",
        protocol: "udp",
        ports: [53],
        description: "test-description",
    });
    
    import pulumi
    import pulumi_netbox as netbox
    
    test = netbox.ServiceTemplate("test",
        name="test-service-template",
        protocol="udp",
        ports=[53],
        description="test-description")
    
    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 {
    		_, err := netbox.NewServiceTemplate(ctx, "test", &netbox.ServiceTemplateArgs{
    			Name:     pulumi.String("test-service-template"),
    			Protocol: pulumi.String("udp"),
    			Ports: pulumi.Float64Array{
    				pulumi.Float64(53),
    			},
    			Description: pulumi.String("test-description"),
    		})
    		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.ServiceTemplate("test", new()
        {
            Name = "test-service-template",
            Protocol = "udp",
            Ports = new[]
            {
                53,
            },
            Description = "test-description",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.netbox.ServiceTemplate;
    import com.pulumi.netbox.ServiceTemplateArgs;
    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 ServiceTemplate("test", ServiceTemplateArgs.builder()
                .name("test-service-template")
                .protocol("udp")
                .ports(53.0)
                .description("test-description")
                .build());
    
        }
    }
    
    resources:
      test:
        type: netbox:ServiceTemplate
        properties:
          name: test-service-template
          protocol: udp
          ports:
            - 53
          description: test-description
    
    Example coming soon!
    

    Create ServiceTemplate Resource

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

    Constructor syntax

    new ServiceTemplate(name: string, args: ServiceTemplateArgs, opts?: CustomResourceOptions);
    @overload
    def ServiceTemplate(resource_name: str,
                        args: ServiceTemplateArgs,
                        opts: Optional[ResourceOptions] = None)
    
    @overload
    def ServiceTemplate(resource_name: str,
                        opts: Optional[ResourceOptions] = None,
                        ports: Optional[Sequence[float]] = None,
                        protocol: Optional[str] = None,
                        comments: Optional[str] = None,
                        custom_fields: Optional[Mapping[str, str]] = None,
                        description: Optional[str] = None,
                        name: Optional[str] = None,
                        owner_id: Optional[float] = None,
                        tags: Optional[Sequence[str]] = None)
    func NewServiceTemplate(ctx *Context, name string, args ServiceTemplateArgs, opts ...ResourceOption) (*ServiceTemplate, error)
    public ServiceTemplate(string name, ServiceTemplateArgs args, CustomResourceOptions? opts = null)
    public ServiceTemplate(String name, ServiceTemplateArgs args)
    public ServiceTemplate(String name, ServiceTemplateArgs args, CustomResourceOptions options)
    
    type: netbox:ServiceTemplate
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "netbox_service_template" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args ServiceTemplateArgs
    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 ServiceTemplateArgs
    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 ServiceTemplateArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ServiceTemplateArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ServiceTemplateArgs
    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 serviceTemplateResource = new Netbox.ServiceTemplate("serviceTemplateResource", new()
    {
        Ports = new[]
        {
            0.0,
        },
        Protocol = "string",
        Comments = "string",
        CustomFields = 
        {
            { "string", "string" },
        },
        Description = "string",
        Name = "string",
        OwnerId = 0.0,
        Tags = new[]
        {
            "string",
        },
    });
    
    example, err := netbox.NewServiceTemplate(ctx, "serviceTemplateResource", &netbox.ServiceTemplateArgs{
    	Ports: pulumi.Float64Array{
    		pulumi.Float64(0),
    	},
    	Protocol: pulumi.String("string"),
    	Comments: pulumi.String("string"),
    	CustomFields: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    	Description: pulumi.String("string"),
    	Name:        pulumi.String("string"),
    	OwnerId:     pulumi.Float64(0),
    	Tags: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    })
    
    resource "netbox_service_template" "serviceTemplateResource" {
      lifecycle {
        create_before_destroy = true
      }
      ports    = [0]
      protocol = "string"
      comments = "string"
      custom_fields = {
        "string" = "string"
      }
      description = "string"
      name        = "string"
      owner_id    = 0
      tags        = ["string"]
    }
    
    var serviceTemplateResource = new ServiceTemplate("serviceTemplateResource", ServiceTemplateArgs.builder()
        .ports(0.0)
        .protocol("string")
        .comments("string")
        .customFields(Map.of("string", "string"))
        .description("string")
        .name("string")
        .ownerId(0.0)
        .tags("string")
        .build());
    
    service_template_resource = netbox.ServiceTemplate("serviceTemplateResource",
        ports=[float(0)],
        protocol="string",
        comments="string",
        custom_fields={
            "string": "string",
        },
        description="string",
        name="string",
        owner_id=float(0),
        tags=["string"])
    
    const serviceTemplateResource = new netbox.ServiceTemplate("serviceTemplateResource", {
        ports: [0],
        protocol: "string",
        comments: "string",
        customFields: {
            string: "string",
        },
        description: "string",
        name: "string",
        ownerId: 0,
        tags: ["string"],
    });
    
    type: netbox:ServiceTemplate
    properties:
        comments: string
        customFields:
            string: string
        description: string
        name: string
        ownerId: 0
        ports:
            - 0
        protocol: string
        tags:
            - string
    

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

    Ports List<double>
    Port numbers.
    Protocol string
    Transport protocol. One of: tcp, udp, sctp.
    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
    Name string
    OwnerId double
    Id of the owner the object is assigned to.
    Tags List<string>
    Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
    Ports []float64
    Port numbers.
    Protocol string
    Transport protocol. One of: tcp, udp, sctp.
    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
    Name string
    OwnerId float64
    Id of the owner the object is assigned to.
    Tags []string
    Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
    ports list(number)
    Port numbers.
    protocol string
    Transport protocol. One of: tcp, udp, sctp.
    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
    name string
    owner_id number
    Id of the owner the object is assigned to.
    tags list(string)
    Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
    ports List<Double>
    Port numbers.
    protocol String
    Transport protocol. One of: tcp, udp, sctp.
    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
    name String
    ownerId Double
    Id of the owner the object is assigned to.
    tags List<String>
    Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
    ports number[]
    Port numbers.
    protocol string
    Transport protocol. One of: tcp, udp, sctp.
    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
    name string
    ownerId number
    Id of the owner the object is assigned to.
    tags string[]
    Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
    ports Sequence[float]
    Port numbers.
    protocol str
    Transport protocol. One of: tcp, udp, sctp.
    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
    name str
    owner_id float
    Id of the owner the object is assigned to.
    tags Sequence[str]
    Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
    ports List<Number>
    Port numbers.
    protocol String
    Transport protocol. One of: tcp, udp, sctp.
    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
    name String
    ownerId Number
    Id of the owner the object is assigned to.
    tags List<String>
    Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).

    Outputs

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

    Created string
    Id string
    The provider-assigned unique ID for this managed resource.
    LastUpdated string
    ServiceTemplateId double
    NetBox id.
    TagsAlls List<string>
    Slugs of all tags on the object, including the provider's default_tags.
    Url string
    Created string
    Id string
    The provider-assigned unique ID for this managed resource.
    LastUpdated string
    ServiceTemplateId float64
    NetBox id.
    TagsAlls []string
    Slugs of all tags on the object, including the provider's default_tags.
    Url string
    created string
    id string
    The provider-assigned unique ID for this managed resource.
    last_updated string
    service_template_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
    id String
    The provider-assigned unique ID for this managed resource.
    lastUpdated String
    serviceTemplateId Double
    NetBox id.
    tagsAlls List<String>
    Slugs of all tags on the object, including the provider's default_tags.
    url String
    created string
    id string
    The provider-assigned unique ID for this managed resource.
    lastUpdated string
    serviceTemplateId number
    NetBox id.
    tagsAlls string[]
    Slugs of all tags on the object, including the provider's default_tags.
    url string
    created str
    id str
    The provider-assigned unique ID for this managed resource.
    last_updated str
    service_template_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
    id String
    The provider-assigned unique ID for this managed resource.
    lastUpdated String
    serviceTemplateId Number
    NetBox id.
    tagsAlls List<String>
    Slugs of all tags on the object, including the provider's default_tags.
    url String

    Look up Existing ServiceTemplate Resource

    Get an existing ServiceTemplate 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?: ServiceTemplateState, opts?: CustomResourceOptions): ServiceTemplate
    @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,
            last_updated: Optional[str] = None,
            name: Optional[str] = None,
            owner_id: Optional[float] = None,
            ports: Optional[Sequence[float]] = None,
            protocol: Optional[str] = None,
            service_template_id: Optional[float] = None,
            tags: Optional[Sequence[str]] = None,
            tags_alls: Optional[Sequence[str]] = None,
            url: Optional[str] = None) -> ServiceTemplate
    func GetServiceTemplate(ctx *Context, name string, id IDInput, state *ServiceTemplateState, opts ...ResourceOption) (*ServiceTemplate, error)
    public static ServiceTemplate Get(string name, Input<string> id, ServiceTemplateState? state, CustomResourceOptions? opts = null)
    public static ServiceTemplate get(String name, Output<String> id, ServiceTemplateState state, CustomResourceOptions options)
    resources:  existingServiceTemplate:    type: netbox:ServiceTemplate    get:      id: ${id}
    import {
      to = netbox_service_template.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 ServiceTemplateState
    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 ServiceTemplateState
    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 ServiceTemplateState
    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 ServiceTemplateState
    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
    LastUpdated string
    Name string
    OwnerId double
    Id of the owner the object is assigned to.
    Ports List<double>
    Port numbers.
    Protocol string
    Transport protocol. One of: tcp, udp, sctp.
    ServiceTemplateId double
    NetBox id.
    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.
    Url string
    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
    LastUpdated string
    Name string
    OwnerId float64
    Id of the owner the object is assigned to.
    Ports []float64
    Port numbers.
    Protocol string
    Transport protocol. One of: tcp, udp, sctp.
    ServiceTemplateId float64
    NetBox id.
    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.
    Url string
    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
    last_updated string
    name string
    owner_id number
    Id of the owner the object is assigned to.
    ports list(number)
    Port numbers.
    protocol string
    Transport protocol. One of: tcp, udp, sctp.
    service_template_id number
    NetBox id.
    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.
    url string
    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
    lastUpdated String
    name String
    ownerId Double
    Id of the owner the object is assigned to.
    ports List<Double>
    Port numbers.
    protocol String
    Transport protocol. One of: tcp, udp, sctp.
    serviceTemplateId Double
    NetBox id.
    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.
    url String
    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
    lastUpdated string
    name string
    ownerId number
    Id of the owner the object is assigned to.
    ports number[]
    Port numbers.
    protocol string
    Transport protocol. One of: tcp, udp, sctp.
    serviceTemplateId number
    NetBox id.
    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.
    url string
    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
    last_updated str
    name str
    owner_id float
    Id of the owner the object is assigned to.
    ports Sequence[float]
    Port numbers.
    protocol str
    Transport protocol. One of: tcp, udp, sctp.
    service_template_id float
    NetBox id.
    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.
    url str
    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
    lastUpdated String
    name String
    ownerId Number
    Id of the owner the object is assigned to.
    ports List<Number>
    Port numbers.
    protocol String
    Transport protocol. One of: tcp, udp, sctp.
    serviceTemplateId Number
    NetBox id.
    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.
    url String

    Import

    In Terraform v1.5.0 and later, the import block can be used with the id attribute, for example:

    terraform

    import {

    to = netbox_service_template.test

    id = “123”

    }

    The pulumi import command can be used, for example:

    $ pulumi import netbox:index/serviceTemplate:ServiceTemplate 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