1. Registry
  2. Packages
  3. Netbox Provider
  4. API Docs
  5. Service
Viewing docs for netbox 6.0.0
published on Wednesday, Nov 4, 2026 by e-breuninger
netbox
Viewing docs for netbox 6.0.0
published on Wednesday, Nov 4, 2026 by e-breuninger

    A service running on a device or virtual machine (ipam.service).

    From the official documentation:

    An application service represents a layer seven application available on a device or virtual machine. For example, a service might be created in NetBox to represent an HTTP server running on TCP/8000. Each service may optionally be further bound to one or more specific interfaces assigned to the selected device or virtual machine.

    To aid in the efficient creation of application services, users may opt to first create an application service template from which service definitions can be quickly replicated.

    Changed in NetBox v4.4: Previously, application services were referred to simply as “services”. 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.Site("test", {name: "test-site"});
    const testManufacturer = new netbox.Manufacturer("test", {name: "test-manufacturer"});
    const testDeviceType = new netbox.DeviceType("test", {
        manufacturerId: testManufacturer.manufacturerId,
        model: "test-device-type",
    });
    const testDeviceRole = new netbox.DeviceRole("test", {name: "test-device-role"});
    const testDevice = new netbox.Device("test", {
        name: "test-device",
        deviceTypeId: testDeviceType.deviceTypeId,
        roleId: testDeviceRole.deviceRoleId,
        siteId: test.siteId,
    });
    const testService = new netbox.Service("test", {
        name: "test-service",
        protocol: "tcp",
        ports: [
            80,
            443,
        ],
        deviceId: testDevice.deviceId,
        description: "test-description",
    });
    
    import pulumi
    import pulumi_netbox as netbox
    
    test = netbox.Site("test", name="test-site")
    test_manufacturer = netbox.Manufacturer("test", name="test-manufacturer")
    test_device_type = netbox.DeviceType("test",
        manufacturer_id=test_manufacturer.manufacturer_id,
        model="test-device-type")
    test_device_role = netbox.DeviceRole("test", name="test-device-role")
    test_device = netbox.Device("test",
        name="test-device",
        device_type_id=test_device_type.device_type_id,
        role_id=test_device_role.device_role_id,
        site_id=test.site_id)
    test_service = netbox.Service("test",
        name="test-service",
        protocol="tcp",
        ports=[
            80,
            443,
        ],
        device_id=test_device.device_id,
        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 {
    		test, err := netbox.NewSite(ctx, "test", &netbox.SiteArgs{
    			Name: pulumi.String("test-site"),
    		})
    		if err != nil {
    			return err
    		}
    		testManufacturer, err := netbox.NewManufacturer(ctx, "test", &netbox.ManufacturerArgs{
    			Name: pulumi.String("test-manufacturer"),
    		})
    		if err != nil {
    			return err
    		}
    		testDeviceType, err := netbox.NewDeviceType(ctx, "test", &netbox.DeviceTypeArgs{
    			ManufacturerId: testManufacturer.ManufacturerId,
    			Model:          pulumi.String("test-device-type"),
    		})
    		if err != nil {
    			return err
    		}
    		testDeviceRole, err := netbox.NewDeviceRole(ctx, "test", &netbox.DeviceRoleArgs{
    			Name: pulumi.String("test-device-role"),
    		})
    		if err != nil {
    			return err
    		}
    		testDevice, err := netbox.NewDevice(ctx, "test", &netbox.DeviceArgs{
    			Name:         pulumi.String("test-device"),
    			DeviceTypeId: testDeviceType.DeviceTypeId,
    			RoleId:       testDeviceRole.DeviceRoleId,
    			SiteId:       test.SiteId,
    		})
    		if err != nil {
    			return err
    		}
    		_, err = netbox.NewService(ctx, "test", &netbox.ServiceArgs{
    			Name:     pulumi.String("test-service"),
    			Protocol: pulumi.String("tcp"),
    			Ports: pulumi.Float64Array{
    				pulumi.Float64(80),
    				pulumi.Float64(443),
    			},
    			DeviceId:    testDevice.DeviceId,
    			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.Site("test", new()
        {
            Name = "test-site",
        });
    
        var testManufacturer = new Netbox.Manufacturer("test", new()
        {
            Name = "test-manufacturer",
        });
    
        var testDeviceType = new Netbox.DeviceType("test", new()
        {
            ManufacturerId = testManufacturer.ManufacturerId,
            Model = "test-device-type",
        });
    
        var testDeviceRole = new Netbox.DeviceRole("test", new()
        {
            Name = "test-device-role",
        });
    
        var testDevice = new Netbox.Device("test", new()
        {
            Name = "test-device",
            DeviceTypeId = testDeviceType.DeviceTypeId,
            RoleId = testDeviceRole.DeviceRoleId,
            SiteId = test.SiteId,
        });
    
        var testService = new Netbox.Service("test", new()
        {
            Name = "test-service",
            Protocol = "tcp",
            Ports = new[]
            {
                80,
                443,
            },
            DeviceId = testDevice.DeviceId,
            Description = "test-description",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.netbox.Site;
    import com.pulumi.netbox.SiteArgs;
    import com.pulumi.netbox.Manufacturer;
    import com.pulumi.netbox.ManufacturerArgs;
    import com.pulumi.netbox.DeviceType;
    import com.pulumi.netbox.DeviceTypeArgs;
    import com.pulumi.netbox.DeviceRole;
    import com.pulumi.netbox.DeviceRoleArgs;
    import com.pulumi.netbox.Device;
    import com.pulumi.netbox.DeviceArgs;
    import com.pulumi.netbox.Service;
    import com.pulumi.netbox.ServiceArgs;
    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 Site("test", SiteArgs.builder()
                .name("test-site")
                .build());
    
            var testManufacturer = new Manufacturer("testManufacturer", ManufacturerArgs.builder()
                .name("test-manufacturer")
                .build());
    
            var testDeviceType = new DeviceType("testDeviceType", DeviceTypeArgs.builder()
                .manufacturerId(testManufacturer.manufacturerId())
                .model("test-device-type")
                .build());
    
            var testDeviceRole = new DeviceRole("testDeviceRole", DeviceRoleArgs.builder()
                .name("test-device-role")
                .build());
    
            var testDevice = new Device("testDevice", DeviceArgs.builder()
                .name("test-device")
                .deviceTypeId(testDeviceType.deviceTypeId())
                .roleId(testDeviceRole.deviceRoleId())
                .siteId(test.siteId())
                .build());
    
            var testService = new Service("testService", ServiceArgs.builder()
                .name("test-service")
                .protocol("tcp")
                .ports(            
                    80.0,
                    443.0)
                .deviceId(testDevice.deviceId())
                .description("test-description")
                .build());
    
        }
    }
    
    resources:
      test:
        type: netbox:Site
        properties:
          name: test-site
      testManufacturer:
        type: netbox:Manufacturer
        name: test
        properties:
          name: test-manufacturer
      testDeviceType:
        type: netbox:DeviceType
        name: test
        properties:
          manufacturerId: ${testManufacturer.manufacturerId}
          model: test-device-type
      testDeviceRole:
        type: netbox:DeviceRole
        name: test
        properties:
          name: test-device-role
      testDevice:
        type: netbox:Device
        name: test
        properties:
          name: test-device
          deviceTypeId: ${testDeviceType.deviceTypeId}
          roleId: ${testDeviceRole.deviceRoleId}
          siteId: ${test.siteId}
      testService:
        type: netbox:Service
        name: test
        properties:
          name: test-service
          protocol: tcp
          ports:
            - 80
            - 443
          deviceId: ${testDevice.deviceId}
          description: test-description
    
    Example coming soon!
    

    Create Service Resource

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

    Constructor syntax

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

    Parameters

    name string
    The unique name of the resource.
    args ServiceArgs
    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 ServiceArgs
    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 ServiceArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ServiceArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ServiceArgs
    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 serviceResource = new Netbox.Service("serviceResource", new()
    {
        Ports = new[]
        {
            0.0,
        },
        Protocol = "string",
        DeviceId = 0.0,
        Comments = "string",
        IpAddressIds = new[]
        {
            0.0,
        },
        Name = "string",
        OwnerId = 0.0,
        ParentObjectId = 0.0,
        ParentObjectType = "string",
        Description = "string",
        CustomFields = 
        {
            { "string", "string" },
        },
        Tags = new[]
        {
            "string",
        },
        VirtualMachineId = 0.0,
    });
    
    example, err := netbox.NewService(ctx, "serviceResource", &netbox.ServiceArgs{
    	Ports: pulumi.Float64Array{
    		pulumi.Float64(0),
    	},
    	Protocol: pulumi.String("string"),
    	DeviceId: pulumi.Float64(0),
    	Comments: pulumi.String("string"),
    	IpAddressIds: pulumi.Float64Array{
    		pulumi.Float64(0),
    	},
    	Name:             pulumi.String("string"),
    	OwnerId:          pulumi.Float64(0),
    	ParentObjectId:   pulumi.Float64(0),
    	ParentObjectType: pulumi.String("string"),
    	Description:      pulumi.String("string"),
    	CustomFields: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    	Tags: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	VirtualMachineId: pulumi.Float64(0),
    })
    
    resource "netbox_service" "serviceResource" {
      lifecycle {
        create_before_destroy = true
      }
      ports              = [0]
      protocol           = "string"
      device_id          = 0
      comments           = "string"
      ip_address_ids     = [0]
      name               = "string"
      owner_id           = 0
      parent_object_id   = 0
      parent_object_type = "string"
      description        = "string"
      custom_fields = {
        "string" = "string"
      }
      tags               = ["string"]
      virtual_machine_id = 0
    }
    
    var serviceResource = new Service("serviceResource", ServiceArgs.builder()
        .ports(0.0)
        .protocol("string")
        .deviceId(0.0)
        .comments("string")
        .ipAddressIds(0.0)
        .name("string")
        .ownerId(0.0)
        .parentObjectId(0.0)
        .parentObjectType("string")
        .description("string")
        .customFields(Map.of("string", "string"))
        .tags("string")
        .virtualMachineId(0.0)
        .build());
    
    service_resource = netbox.Service("serviceResource",
        ports=[float(0)],
        protocol="string",
        device_id=float(0),
        comments="string",
        ip_address_ids=[float(0)],
        name="string",
        owner_id=float(0),
        parent_object_id=float(0),
        parent_object_type="string",
        description="string",
        custom_fields={
            "string": "string",
        },
        tags=["string"],
        virtual_machine_id=float(0))
    
    const serviceResource = new netbox.Service("serviceResource", {
        ports: [0],
        protocol: "string",
        deviceId: 0,
        comments: "string",
        ipAddressIds: [0],
        name: "string",
        ownerId: 0,
        parentObjectId: 0,
        parentObjectType: "string",
        description: "string",
        customFields: {
            string: "string",
        },
        tags: ["string"],
        virtualMachineId: 0,
    });
    
    type: netbox:Service
    properties:
        comments: string
        customFields:
            string: string
        description: string
        deviceId: 0
        ipAddressIds:
            - 0
        name: string
        ownerId: 0
        parentObjectId: 0
        parentObjectType: string
        ports:
            - 0
        protocol: string
        tags:
            - string
        virtualMachineId: 0
    

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

    Ports List<double>
    Port numbers the service listens on.
    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
    DeviceId double
    Id of the device the service runs on (parentobjecttype dcim.device). Conflicts with virtualmachineid and with setting the parent*object** pair directly.
    IpAddressIds List<double>
    Ids of the IP addresses the service is bound to; all of the parent object's addresses when unset.
    Name string
    OwnerId double
    Id of the owner the object is assigned to.
    ParentObjectId double
    Id of the object named by parentobjecttype.
    ParentObjectType string
    Content type of the object the service runs on. Derived from deviceid or virtualmachineid when one of those is set; set it together with parentobject_id to address the object directly. One of: dcim.device, virtualization.virtualmachine.
    Tags List<string>
    Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
    VirtualMachineId double
    Id of the virtual machine the service runs on (parentobjecttype virtualization.virtualmachine). Conflicts with deviceid and with setting the parentobject_* pair directly.
    Ports []float64
    Port numbers the service listens on.
    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
    DeviceId float64
    Id of the device the service runs on (parentobjecttype dcim.device). Conflicts with virtualmachineid and with setting the parent*object** pair directly.
    IpAddressIds []float64
    Ids of the IP addresses the service is bound to; all of the parent object's addresses when unset.
    Name string
    OwnerId float64
    Id of the owner the object is assigned to.
    ParentObjectId float64
    Id of the object named by parentobjecttype.
    ParentObjectType string
    Content type of the object the service runs on. Derived from deviceid or virtualmachineid when one of those is set; set it together with parentobject_id to address the object directly. One of: dcim.device, virtualization.virtualmachine.
    Tags []string
    Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
    VirtualMachineId float64
    Id of the virtual machine the service runs on (parentobjecttype virtualization.virtualmachine). Conflicts with deviceid and with setting the parentobject_* pair directly.
    ports list(number)
    Port numbers the service listens on.
    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
    device_id number
    Id of the device the service runs on (parentobjecttype dcim.device). Conflicts with virtualmachineid and with setting the parent*object** pair directly.
    ip_address_ids list(number)
    Ids of the IP addresses the service is bound to; all of the parent object's addresses when unset.
    name string
    owner_id number
    Id of the owner the object is assigned to.
    parent_object_id number
    Id of the object named by parentobjecttype.
    parent_object_type string
    Content type of the object the service runs on. Derived from deviceid or virtualmachineid when one of those is set; set it together with parentobject_id to address the object directly. One of: dcim.device, virtualization.virtualmachine.
    tags list(string)
    Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
    virtual_machine_id number
    Id of the virtual machine the service runs on (parentobjecttype virtualization.virtualmachine). Conflicts with deviceid and with setting the parentobject_* pair directly.
    ports List<Double>
    Port numbers the service listens on.
    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
    deviceId Double
    Id of the device the service runs on (parentobjecttype dcim.device). Conflicts with virtualmachineid and with setting the parent*object** pair directly.
    ipAddressIds List<Double>
    Ids of the IP addresses the service is bound to; all of the parent object's addresses when unset.
    name String
    ownerId Double
    Id of the owner the object is assigned to.
    parentObjectId Double
    Id of the object named by parentobjecttype.
    parentObjectType String
    Content type of the object the service runs on. Derived from deviceid or virtualmachineid when one of those is set; set it together with parentobject_id to address the object directly. One of: dcim.device, virtualization.virtualmachine.
    tags List<String>
    Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
    virtualMachineId Double
    Id of the virtual machine the service runs on (parentobjecttype virtualization.virtualmachine). Conflicts with deviceid and with setting the parentobject_* pair directly.
    ports number[]
    Port numbers the service listens on.
    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
    deviceId number
    Id of the device the service runs on (parentobjecttype dcim.device). Conflicts with virtualmachineid and with setting the parent*object** pair directly.
    ipAddressIds number[]
    Ids of the IP addresses the service is bound to; all of the parent object's addresses when unset.
    name string
    ownerId number
    Id of the owner the object is assigned to.
    parentObjectId number
    Id of the object named by parentobjecttype.
    parentObjectType string
    Content type of the object the service runs on. Derived from deviceid or virtualmachineid when one of those is set; set it together with parentobject_id to address the object directly. One of: dcim.device, virtualization.virtualmachine.
    tags string[]
    Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
    virtualMachineId number
    Id of the virtual machine the service runs on (parentobjecttype virtualization.virtualmachine). Conflicts with deviceid and with setting the parentobject_* pair directly.
    ports Sequence[float]
    Port numbers the service listens on.
    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
    device_id float
    Id of the device the service runs on (parentobjecttype dcim.device). Conflicts with virtualmachineid and with setting the parent*object** pair directly.
    ip_address_ids Sequence[float]
    Ids of the IP addresses the service is bound to; all of the parent object's addresses when unset.
    name str
    owner_id float
    Id of the owner the object is assigned to.
    parent_object_id float
    Id of the object named by parentobjecttype.
    parent_object_type str
    Content type of the object the service runs on. Derived from deviceid or virtualmachineid when one of those is set; set it together with parentobject_id to address the object directly. One of: dcim.device, virtualization.virtualmachine.
    tags Sequence[str]
    Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
    virtual_machine_id float
    Id of the virtual machine the service runs on (parentobjecttype virtualization.virtualmachine). Conflicts with deviceid and with setting the parentobject_* pair directly.
    ports List<Number>
    Port numbers the service listens on.
    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
    deviceId Number
    Id of the device the service runs on (parentobjecttype dcim.device). Conflicts with virtualmachineid and with setting the parent*object** pair directly.
    ipAddressIds List<Number>
    Ids of the IP addresses the service is bound to; all of the parent object's addresses when unset.
    name String
    ownerId Number
    Id of the owner the object is assigned to.
    parentObjectId Number
    Id of the object named by parentobjecttype.
    parentObjectType String
    Content type of the object the service runs on. Derived from deviceid or virtualmachineid when one of those is set; set it together with parentobject_id to address the object directly. One of: dcim.device, virtualization.virtualmachine.
    tags List<String>
    Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
    virtualMachineId Number
    Id of the virtual machine the service runs on (parentobjecttype virtualization.virtualmachine). Conflicts with deviceid and with setting the parentobject_* pair directly.

    Outputs

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

    Created string
    Id string
    The provider-assigned unique ID for this managed resource.
    LastUpdated string
    ServiceId 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
    ServiceId 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_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
    serviceId 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
    serviceId 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_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
    serviceId Number
    NetBox id.
    tagsAlls List<String>
    Slugs of all tags on the object, including the provider's default_tags.
    url String

    Look up Existing Service Resource

    Get an existing Service 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?: ServiceState, opts?: CustomResourceOptions): Service
    @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,
            device_id: Optional[float] = None,
            ip_address_ids: Optional[Sequence[float]] = None,
            last_updated: Optional[str] = None,
            name: Optional[str] = None,
            owner_id: Optional[float] = None,
            parent_object_id: Optional[float] = None,
            parent_object_type: Optional[str] = None,
            ports: Optional[Sequence[float]] = None,
            protocol: Optional[str] = None,
            service_id: Optional[float] = None,
            tags: Optional[Sequence[str]] = None,
            tags_alls: Optional[Sequence[str]] = None,
            url: Optional[str] = None,
            virtual_machine_id: Optional[float] = None) -> Service
    func GetService(ctx *Context, name string, id IDInput, state *ServiceState, opts ...ResourceOption) (*Service, error)
    public static Service Get(string name, Input<string> id, ServiceState? state, CustomResourceOptions? opts = null)
    public static Service get(String name, Output<String> id, ServiceState state, CustomResourceOptions options)
    resources:  _:    type: netbox:Service    get:      id: ${id}
    import {
      to = netbox_service.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:
    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
    DeviceId double
    Id of the device the service runs on (parentobjecttype dcim.device). Conflicts with virtualmachineid and with setting the parent*object** pair directly.
    IpAddressIds List<double>
    Ids of the IP addresses the service is bound to; all of the parent object's addresses when unset.
    LastUpdated string
    Name string
    OwnerId double
    Id of the owner the object is assigned to.
    ParentObjectId double
    Id of the object named by parentobjecttype.
    ParentObjectType string
    Content type of the object the service runs on. Derived from deviceid or virtualmachineid when one of those is set; set it together with parentobject_id to address the object directly. One of: dcim.device, virtualization.virtualmachine.
    Ports List<double>
    Port numbers the service listens on.
    Protocol string
    Transport protocol. One of: tcp, udp, sctp.
    ServiceId 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
    VirtualMachineId double
    Id of the virtual machine the service runs on (parentobjecttype virtualization.virtualmachine). Conflicts with deviceid and with setting the parentobject_* pair directly.
    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
    DeviceId float64
    Id of the device the service runs on (parentobjecttype dcim.device). Conflicts with virtualmachineid and with setting the parent*object** pair directly.
    IpAddressIds []float64
    Ids of the IP addresses the service is bound to; all of the parent object's addresses when unset.
    LastUpdated string
    Name string
    OwnerId float64
    Id of the owner the object is assigned to.
    ParentObjectId float64
    Id of the object named by parentobjecttype.
    ParentObjectType string
    Content type of the object the service runs on. Derived from deviceid or virtualmachineid when one of those is set; set it together with parentobject_id to address the object directly. One of: dcim.device, virtualization.virtualmachine.
    Ports []float64
    Port numbers the service listens on.
    Protocol string
    Transport protocol. One of: tcp, udp, sctp.
    ServiceId 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
    VirtualMachineId float64
    Id of the virtual machine the service runs on (parentobjecttype virtualization.virtualmachine). Conflicts with deviceid and with setting the parentobject_* pair directly.
    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
    device_id number
    Id of the device the service runs on (parentobjecttype dcim.device). Conflicts with virtualmachineid and with setting the parent*object** pair directly.
    ip_address_ids list(number)
    Ids of the IP addresses the service is bound to; all of the parent object's addresses when unset.
    last_updated string
    name string
    owner_id number
    Id of the owner the object is assigned to.
    parent_object_id number
    Id of the object named by parentobjecttype.
    parent_object_type string
    Content type of the object the service runs on. Derived from deviceid or virtualmachineid when one of those is set; set it together with parentobject_id to address the object directly. One of: dcim.device, virtualization.virtualmachine.
    ports list(number)
    Port numbers the service listens on.
    protocol string
    Transport protocol. One of: tcp, udp, sctp.
    service_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
    virtual_machine_id number
    Id of the virtual machine the service runs on (parentobjecttype virtualization.virtualmachine). Conflicts with deviceid and with setting the parentobject_* pair directly.
    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
    deviceId Double
    Id of the device the service runs on (parentobjecttype dcim.device). Conflicts with virtualmachineid and with setting the parent*object** pair directly.
    ipAddressIds List<Double>
    Ids of the IP addresses the service is bound to; all of the parent object's addresses when unset.
    lastUpdated String
    name String
    ownerId Double
    Id of the owner the object is assigned to.
    parentObjectId Double
    Id of the object named by parentobjecttype.
    parentObjectType String
    Content type of the object the service runs on. Derived from deviceid or virtualmachineid when one of those is set; set it together with parentobject_id to address the object directly. One of: dcim.device, virtualization.virtualmachine.
    ports List<Double>
    Port numbers the service listens on.
    protocol String
    Transport protocol. One of: tcp, udp, sctp.
    serviceId 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
    virtualMachineId Double
    Id of the virtual machine the service runs on (parentobjecttype virtualization.virtualmachine). Conflicts with deviceid and with setting the parentobject_* pair directly.
    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
    deviceId number
    Id of the device the service runs on (parentobjecttype dcim.device). Conflicts with virtualmachineid and with setting the parent*object** pair directly.
    ipAddressIds number[]
    Ids of the IP addresses the service is bound to; all of the parent object's addresses when unset.
    lastUpdated string
    name string
    ownerId number
    Id of the owner the object is assigned to.
    parentObjectId number
    Id of the object named by parentobjecttype.
    parentObjectType string
    Content type of the object the service runs on. Derived from deviceid or virtualmachineid when one of those is set; set it together with parentobject_id to address the object directly. One of: dcim.device, virtualization.virtualmachine.
    ports number[]
    Port numbers the service listens on.
    protocol string
    Transport protocol. One of: tcp, udp, sctp.
    serviceId 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
    virtualMachineId number
    Id of the virtual machine the service runs on (parentobjecttype virtualization.virtualmachine). Conflicts with deviceid and with setting the parentobject_* pair directly.
    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
    device_id float
    Id of the device the service runs on (parentobjecttype dcim.device). Conflicts with virtualmachineid and with setting the parent*object** pair directly.
    ip_address_ids Sequence[float]
    Ids of the IP addresses the service is bound to; all of the parent object's addresses when unset.
    last_updated str
    name str
    owner_id float
    Id of the owner the object is assigned to.
    parent_object_id float
    Id of the object named by parentobjecttype.
    parent_object_type str
    Content type of the object the service runs on. Derived from deviceid or virtualmachineid when one of those is set; set it together with parentobject_id to address the object directly. One of: dcim.device, virtualization.virtualmachine.
    ports Sequence[float]
    Port numbers the service listens on.
    protocol str
    Transport protocol. One of: tcp, udp, sctp.
    service_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
    virtual_machine_id float
    Id of the virtual machine the service runs on (parentobjecttype virtualization.virtualmachine). Conflicts with deviceid and with setting the parentobject_* pair directly.
    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
    deviceId Number
    Id of the device the service runs on (parentobjecttype dcim.device). Conflicts with virtualmachineid and with setting the parent*object** pair directly.
    ipAddressIds List<Number>
    Ids of the IP addresses the service is bound to; all of the parent object's addresses when unset.
    lastUpdated String
    name String
    ownerId Number
    Id of the owner the object is assigned to.
    parentObjectId Number
    Id of the object named by parentobjecttype.
    parentObjectType String
    Content type of the object the service runs on. Derived from deviceid or virtualmachineid when one of those is set; set it together with parentobject_id to address the object directly. One of: dcim.device, virtualization.virtualmachine.
    ports List<Number>
    Port numbers the service listens on.
    protocol String
    Transport protocol. One of: tcp, udp, sctp.
    serviceId 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
    virtualMachineId Number
    Id of the virtual machine the service runs on (parentobjecttype virtualization.virtualmachine). Conflicts with deviceid and with setting the parentobject_* pair directly.

    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.test

    id = “123”

    }

    The pulumi import command can be used, for example:

    $ pulumi import netbox:index/service:Service 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.0
    published on Wednesday, Nov 4, 2026 by e-breuninger

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial