published on Wednesday, Nov 4, 2026 by e-breuninger
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
- Custom
Fields 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
- Device
Id double - Id of the device the service runs on (parentobjecttype dcim.device). Conflicts with virtualmachineid and with setting the parent*object** pair directly.
- Ip
Address List<double>Ids - Ids of the IP addresses the service is bound to; all of the parent object's addresses when unset.
- Name string
- Owner
Id double - Id of the owner the object is assigned to.
- Parent
Object doubleId - Id of the object named by parentobjecttype.
- Parent
Object stringType - 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.
- List<string>
- Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
- Virtual
Machine doubleId - 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
- Custom
Fields 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
- Device
Id float64 - Id of the device the service runs on (parentobjecttype dcim.device). Conflicts with virtualmachineid and with setting the parent*object** pair directly.
- Ip
Address []float64Ids - Ids of the IP addresses the service is bound to; all of the parent object's addresses when unset.
- Name string
- Owner
Id float64 - Id of the owner the object is assigned to.
- Parent
Object float64Id - Id of the object named by parentobjecttype.
- Parent
Object stringType - 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.
- []string
- Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
- Virtual
Machine float64Id - 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_ list(number)ids - 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_ numberid - Id of the object named by parentobjecttype.
- parent_
object_ stringtype - 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.
- list(string)
- Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
- virtual_
machine_ numberid - 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
- custom
Fields 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
- device
Id Double - Id of the device the service runs on (parentobjecttype dcim.device). Conflicts with virtualmachineid and with setting the parent*object** pair directly.
- ip
Address List<Double>Ids - Ids of the IP addresses the service is bound to; all of the parent object's addresses when unset.
- name String
- owner
Id Double - Id of the owner the object is assigned to.
- parent
Object DoubleId - Id of the object named by parentobjecttype.
- parent
Object StringType - 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.
- List<String>
- Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
- virtual
Machine DoubleId - 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
- custom
Fields {[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
- 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 number[]Ids - 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 numberId - Id of the object named by parentobjecttype.
- parent
Object stringType - 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.
- string[]
- Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
- virtual
Machine numberId - 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_ Sequence[float]ids - 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_ floatid - Id of the object named by parentobjecttype.
- parent_
object_ strtype - 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.
- Sequence[str]
- Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
- virtual_
machine_ floatid - 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 List<Number>Ids - 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 NumberId - Id of the object named by parentobjecttype.
- parent
Object StringType - 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.
- List<String>
- Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
- virtual
Machine NumberId - 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.
- Last
Updated string - Service
Id double - NetBox id.
- 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.
- Last
Updated string - Service
Id float64 - NetBox id.
- []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.
- 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.
- last
Updated String - service
Id Double - NetBox id.
- 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.
- last
Updated string - service
Id number - NetBox id.
- 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.
- 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.
- last
Updated String - service
Id Number - NetBox id.
- 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) -> Servicefunc 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.
- Comments string
- Created string
- Custom
Fields 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
- Device
Id double - Id of the device the service runs on (parentobjecttype dcim.device). Conflicts with virtualmachineid and with setting the parent*object** pair directly.
- Ip
Address List<double>Ids - 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 double - Id of the owner the object is assigned to.
- Parent
Object doubleId - Id of the object named by parentobjecttype.
- Parent
Object stringType - 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.
- Service
Id double - NetBox id.
- List<string>
- Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
- List<string>
- Slugs of all tags on the object, including the provider's default_tags.
- Url string
- Virtual
Machine doubleId - 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]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 float64 - Id of the device the service runs on (parentobjecttype dcim.device). Conflicts with virtualmachineid and with setting the parent*object** pair directly.
- Ip
Address []float64Ids - 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 float64 - Id of the owner the object is assigned to.
- Parent
Object float64Id - Id of the object named by parentobjecttype.
- Parent
Object stringType - 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.
- Service
Id float64 - NetBox id.
- []string
- Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
- []string
- Slugs of all tags on the object, including the provider's default_tags.
- Url string
- Virtual
Machine float64Id - 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_ list(number)ids - 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_ numberid - Id of the object named by parentobjecttype.
- parent_
object_ stringtype - 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.
- list(string)
- Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
- list(string)
- Slugs of all tags on the object, including the provider's default_tags.
- url string
- virtual_
machine_ numberid - 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,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 Double - Id of the device the service runs on (parentobjecttype dcim.device). Conflicts with virtualmachineid and with setting the parent*object** pair directly.
- ip
Address List<Double>Ids - 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 Double - Id of the owner the object is assigned to.
- parent
Object DoubleId - Id of the object named by parentobjecttype.
- parent
Object StringType - 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.
- service
Id Double - NetBox id.
- List<String>
- Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
- List<String>
- Slugs of all tags on the object, including the provider's default_tags.
- url String
- virtual
Machine DoubleId - 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 {[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
- 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 number[]Ids - 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 numberId - Id of the object named by parentobjecttype.
- parent
Object stringType - 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.
- service
Id number - NetBox id.
- string[]
- Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
- string[]
- Slugs of all tags on the object, including the provider's default_tags.
- url string
- virtual
Machine numberId - 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_ Sequence[float]ids - 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_ floatid - Id of the object named by parentobjecttype.
- parent_
object_ strtype - 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.
- Sequence[str]
- Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
- Sequence[str]
- Slugs of all tags on the object, including the provider's default_tags.
- url str
- virtual_
machine_ floatid - 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 List<Number>Ids - 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 NumberId - Id of the object named by parentobjecttype.
- parent
Object StringType - 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.
- List<String>
- Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
- List<String>
- Slugs of all tags on the object, including the provider's default_tags.
- url String
- virtual
Machine NumberId - 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
netboxTerraform Provider.
published on Wednesday, Nov 4, 2026 by e-breuninger