published on Wednesday, Nov 4, 2026 by e-breuninger
published on Wednesday, Nov 4, 2026 by e-breuninger
A NetBox contact (tenancy.contact).
From the official documentation:
A contact should represent an individual or permanent point of contact. Each contact must define a name, and may optionally include a title, phone number, email address, and related details.
Contacts are reused for assignments, so each unique contact must be created only once and can be assigned to any number of NetBox objects, and there is no limit to the number of assigned contacts an object may have. Most core objects in NetBox can have contacts assigned to them.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as netbox from "@pulumi/netbox";
const test = new netbox.ContactGroup("test", {name: "test-contact-group"});
const testContact = new netbox.Contact("test", {
name: "test-contact",
title: "test-title",
phone: "+1 555 0100",
email: "test-contact@example.com",
address: "test-address",
link: "https://example.com/test-contact",
description: "test-description",
groupIds: [test.contactGroupId],
});
import pulumi
import pulumi_netbox as netbox
test = netbox.ContactGroup("test", name="test-contact-group")
test_contact = netbox.Contact("test",
name="test-contact",
title="test-title",
phone="+1 555 0100",
email="test-contact@example.com",
address="test-address",
link="https://example.com/test-contact",
description="test-description",
group_ids=[test.contact_group_id])
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.NewContactGroup(ctx, "test", &netbox.ContactGroupArgs{
Name: pulumi.String("test-contact-group"),
})
if err != nil {
return err
}
_, err = netbox.NewContact(ctx, "test", &netbox.ContactArgs{
Name: pulumi.String("test-contact"),
Title: pulumi.String("test-title"),
Phone: pulumi.String("+1 555 0100"),
Email: pulumi.String("test-contact@example.com"),
Address: pulumi.String("test-address"),
Link: pulumi.String("https://example.com/test-contact"),
Description: pulumi.String("test-description"),
GroupIds: pulumi.Float64Array{
test.ContactGroupId,
},
})
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.ContactGroup("test", new()
{
Name = "test-contact-group",
});
var testContact = new Netbox.Contact("test", new()
{
Name = "test-contact",
Title = "test-title",
Phone = "+1 555 0100",
Email = "test-contact@example.com",
Address = "test-address",
Link = "https://example.com/test-contact",
Description = "test-description",
GroupIds = new[]
{
test.ContactGroupId,
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.netbox.ContactGroup;
import com.pulumi.netbox.ContactGroupArgs;
import com.pulumi.netbox.Contact;
import com.pulumi.netbox.ContactArgs;
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 ContactGroup("test", ContactGroupArgs.builder()
.name("test-contact-group")
.build());
var testContact = new Contact("testContact", ContactArgs.builder()
.name("test-contact")
.title("test-title")
.phone("+1 555 0100")
.email("test-contact@example.com")
.address("test-address")
.link("https://example.com/test-contact")
.description("test-description")
.groupIds(test.contactGroupId())
.build());
}
}
resources:
test:
type: netbox:ContactGroup
properties:
name: test-contact-group
testContact:
type: netbox:Contact
name: test
properties:
name: test-contact
title: test-title
phone: +1 555 0100
email: test-contact@example.com
address: test-address
link: https://example.com/test-contact
description: test-description
groupIds:
- ${test.contactGroupId}
Example coming soon!
Create Contact Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Contact(name: string, args?: ContactArgs, opts?: CustomResourceOptions);@overload
def Contact(resource_name: str,
args: Optional[ContactArgs] = None,
opts: Optional[ResourceOptions] = None)
@overload
def Contact(resource_name: str,
opts: Optional[ResourceOptions] = None,
address: Optional[str] = None,
comments: Optional[str] = None,
custom_fields: Optional[Mapping[str, str]] = None,
description: Optional[str] = None,
email: Optional[str] = None,
group_ids: Optional[Sequence[float]] = None,
link: Optional[str] = None,
name: Optional[str] = None,
owner_id: Optional[float] = None,
phone: Optional[str] = None,
tags: Optional[Sequence[str]] = None,
title: Optional[str] = None)func NewContact(ctx *Context, name string, args *ContactArgs, opts ...ResourceOption) (*Contact, error)public Contact(string name, ContactArgs? args = null, CustomResourceOptions? opts = null)
public Contact(String name, ContactArgs args)
public Contact(String name, ContactArgs args, CustomResourceOptions options)
type: netbox:Contact
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
resource "netbox_contact" "name" {
# resource properties
}Parameters
- name string
- The unique name of the resource.
- args ContactArgs
- 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 ContactArgs
- 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 ContactArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ContactArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ContactArgs
- 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 contactResource = new Netbox.Contact("contactResource", new()
{
Address = "string",
Comments = "string",
CustomFields =
{
{ "string", "string" },
},
Description = "string",
Email = "string",
GroupIds = new[]
{
0.0,
},
Link = "string",
Name = "string",
OwnerId = 0.0,
Phone = "string",
Tags = new[]
{
"string",
},
Title = "string",
});
example, err := netbox.NewContact(ctx, "contactResource", &netbox.ContactArgs{
Address: pulumi.String("string"),
Comments: pulumi.String("string"),
CustomFields: pulumi.StringMap{
"string": pulumi.String("string"),
},
Description: pulumi.String("string"),
Email: pulumi.String("string"),
GroupIds: pulumi.Float64Array{
pulumi.Float64(0),
},
Link: pulumi.String("string"),
Name: pulumi.String("string"),
OwnerId: pulumi.Float64(0),
Phone: pulumi.String("string"),
Tags: pulumi.StringArray{
pulumi.String("string"),
},
Title: pulumi.String("string"),
})
resource "netbox_contact" "contactResource" {
lifecycle {
create_before_destroy = true
}
address = "string"
comments = "string"
custom_fields = {
"string" = "string"
}
description = "string"
email = "string"
group_ids = [0]
link = "string"
name = "string"
owner_id = 0
phone = "string"
tags = ["string"]
title = "string"
}
var contactResource = new Contact("contactResource", ContactArgs.builder()
.address("string")
.comments("string")
.customFields(Map.of("string", "string"))
.description("string")
.email("string")
.groupIds(0.0)
.link("string")
.name("string")
.ownerId(0.0)
.phone("string")
.tags("string")
.title("string")
.build());
contact_resource = netbox.Contact("contactResource",
address="string",
comments="string",
custom_fields={
"string": "string",
},
description="string",
email="string",
group_ids=[float(0)],
link="string",
name="string",
owner_id=float(0),
phone="string",
tags=["string"],
title="string")
const contactResource = new netbox.Contact("contactResource", {
address: "string",
comments: "string",
customFields: {
string: "string",
},
description: "string",
email: "string",
groupIds: [0],
link: "string",
name: "string",
ownerId: 0,
phone: "string",
tags: ["string"],
title: "string",
});
type: netbox:Contact
properties:
address: string
comments: string
customFields:
string: string
description: string
email: string
groupIds:
- 0
link: string
name: string
ownerId: 0
phone: string
tags:
- string
title: string
Contact 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 Contact resource accepts the following input properties:
- Address string
- 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
- Email string
- Email address.
- Group
Ids List<double> - Ids of contact groups this contact belongs to.
- Link string
- URL related to the contact.
- Name string
- Owner
Id double - Id of the owner the object is assigned to.
- Phone string
- List<string>
- Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
- Title string
- Address string
- 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
- Email string
- Email address.
- Group
Ids []float64 - Ids of contact groups this contact belongs to.
- Link string
- URL related to the contact.
- Name string
- Owner
Id float64 - Id of the owner the object is assigned to.
- Phone string
- []string
- Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
- Title string
- address string
- 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
- email string
- Email address.
- group_
ids list(number) - Ids of contact groups this contact belongs to.
- link string
- URL related to the contact.
- name string
- owner_
id number - Id of the owner the object is assigned to.
- phone string
- list(string)
- Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
- title string
- address String
- 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
- email String
- Email address.
- group
Ids List<Double> - Ids of contact groups this contact belongs to.
- link String
- URL related to the contact.
- name String
- owner
Id Double - Id of the owner the object is assigned to.
- phone String
- List<String>
- Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
- title String
- address string
- 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
- email string
- Email address.
- group
Ids number[] - Ids of contact groups this contact belongs to.
- link string
- URL related to the contact.
- name string
- owner
Id number - Id of the owner the object is assigned to.
- phone string
- string[]
- Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
- title string
- address str
- 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
- email str
- Email address.
- group_
ids Sequence[float] - Ids of contact groups this contact belongs to.
- link str
- URL related to the contact.
- name str
- owner_
id float - Id of the owner the object is assigned to.
- phone str
- Sequence[str]
- Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
- title str
- address String
- 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
- email String
- Email address.
- group
Ids List<Number> - Ids of contact groups this contact belongs to.
- link String
- URL related to the contact.
- name String
- owner
Id Number - Id of the owner the object is assigned to.
- phone String
- List<String>
- Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
- title String
Outputs
All input properties are implicitly available as output properties. Additionally, the Contact resource produces the following output properties:
- Contact
Id double - NetBox id.
- Created string
- Id string
- The provider-assigned unique ID for this managed resource.
- Last
Updated string - List<string>
- Slugs of all tags on the object, including the provider's default_tags.
- Url string
- Contact
Id float64 - NetBox id.
- Created string
- Id string
- The provider-assigned unique ID for this managed resource.
- Last
Updated string - []string
- Slugs of all tags on the object, including the provider's default_tags.
- Url string
- contact_
id number - NetBox id.
- created string
- id string
- The provider-assigned unique ID for this managed resource.
- last_
updated string - list(string)
- Slugs of all tags on the object, including the provider's default_tags.
- url string
- contact
Id Double - NetBox id.
- created String
- id String
- The provider-assigned unique ID for this managed resource.
- last
Updated String - List<String>
- Slugs of all tags on the object, including the provider's default_tags.
- url String
- contact
Id number - NetBox id.
- created string
- id string
- The provider-assigned unique ID for this managed resource.
- last
Updated string - string[]
- Slugs of all tags on the object, including the provider's default_tags.
- url string
- contact_
id float - NetBox id.
- created str
- id str
- The provider-assigned unique ID for this managed resource.
- last_
updated str - Sequence[str]
- Slugs of all tags on the object, including the provider's default_tags.
- url str
- contact
Id Number - NetBox id.
- created String
- id String
- The provider-assigned unique ID for this managed resource.
- last
Updated String - List<String>
- Slugs of all tags on the object, including the provider's default_tags.
- url String
Look up Existing Contact Resource
Get an existing Contact 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?: ContactState, opts?: CustomResourceOptions): Contact@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
address: Optional[str] = None,
comments: Optional[str] = None,
contact_id: Optional[float] = None,
created: Optional[str] = None,
custom_fields: Optional[Mapping[str, str]] = None,
description: Optional[str] = None,
email: Optional[str] = None,
group_ids: Optional[Sequence[float]] = None,
last_updated: Optional[str] = None,
link: Optional[str] = None,
name: Optional[str] = None,
owner_id: Optional[float] = None,
phone: Optional[str] = None,
tags: Optional[Sequence[str]] = None,
tags_alls: Optional[Sequence[str]] = None,
title: Optional[str] = None,
url: Optional[str] = None) -> Contactfunc GetContact(ctx *Context, name string, id IDInput, state *ContactState, opts ...ResourceOption) (*Contact, error)public static Contact Get(string name, Input<string> id, ContactState? state, CustomResourceOptions? opts = null)public static Contact get(String name, Output<String> id, ContactState state, CustomResourceOptions options)resources: _: type: netbox:Contact get: id: ${id}import {
to = netbox_contact.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.
- Address string
- Comments string
- Contact
Id double - NetBox id.
- 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
- Email string
- Email address.
- Group
Ids List<double> - Ids of contact groups this contact belongs to.
- Last
Updated string - Link string
- URL related to the contact.
- Name string
- Owner
Id double - Id of the owner the object is assigned to.
- Phone string
- 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.
- Title string
- Url string
- Address string
- Comments string
- Contact
Id float64 - NetBox id.
- 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
- Email string
- Email address.
- Group
Ids []float64 - Ids of contact groups this contact belongs to.
- Last
Updated string - Link string
- URL related to the contact.
- Name string
- Owner
Id float64 - Id of the owner the object is assigned to.
- Phone string
- []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.
- Title string
- Url string
- address string
- comments string
- contact_
id number - NetBox id.
- 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
- email string
- Email address.
- group_
ids list(number) - Ids of contact groups this contact belongs to.
- last_
updated string - link string
- URL related to the contact.
- name string
- owner_
id number - Id of the owner the object is assigned to.
- phone string
- 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.
- title string
- url string
- address String
- comments String
- contact
Id Double - NetBox id.
- 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
- email String
- Email address.
- group
Ids List<Double> - Ids of contact groups this contact belongs to.
- last
Updated String - link String
- URL related to the contact.
- name String
- owner
Id Double - Id of the owner the object is assigned to.
- phone String
- 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.
- title String
- url String
- address string
- comments string
- contact
Id number - NetBox id.
- 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
- email string
- Email address.
- group
Ids number[] - Ids of contact groups this contact belongs to.
- last
Updated string - link string
- URL related to the contact.
- name string
- owner
Id number - Id of the owner the object is assigned to.
- phone string
- 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.
- title string
- url string
- address str
- comments str
- contact_
id float - NetBox id.
- 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
- email str
- Email address.
- group_
ids Sequence[float] - Ids of contact groups this contact belongs to.
- last_
updated str - link str
- URL related to the contact.
- name str
- owner_
id float - Id of the owner the object is assigned to.
- phone str
- 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.
- title str
- url str
- address String
- comments String
- contact
Id Number - NetBox id.
- 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
- email String
- Email address.
- group
Ids List<Number> - Ids of contact groups this contact belongs to.
- last
Updated String - link String
- URL related to the contact.
- name String
- owner
Id Number - Id of the owner the object is assigned to.
- phone String
- 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.
- title String
- 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_contact.test
id = “123”
}
The pulumi import command can be used, for example:
$ pulumi import netbox:index/contact:Contact 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