published on Monday, Nov 16, 2026 by e-breuninger
published on Monday, Nov 16, 2026 by e-breuninger
A NetBox contact group (tenancy.contactgroup).
From the official documentation:
Contacts can be grouped arbitrarily into a recursive hierarchy, and a contact can be assigned to a group at any level within the hierarchy.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as netbox from "@pulumi/netbox";
const testA = new netbox.ContactGroup("test_a", {
name: "test-contact-group-a",
description: "test-description",
});
const testB = new netbox.ContactGroup("test_b", {
name: "test-contact-group-b",
parentId: testA.contactGroupId,
});
import pulumi
import pulumi_netbox as netbox
test_a = netbox.ContactGroup("test_a",
name="test-contact-group-a",
description="test-description")
test_b = netbox.ContactGroup("test_b",
name="test-contact-group-b",
parent_id=test_a.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 {
testA, err := netbox.NewContactGroup(ctx, "test_a", &netbox.ContactGroupArgs{
Name: pulumi.String("test-contact-group-a"),
Description: pulumi.String("test-description"),
})
if err != nil {
return err
}
_, err = netbox.NewContactGroup(ctx, "test_b", &netbox.ContactGroupArgs{
Name: pulumi.String("test-contact-group-b"),
ParentId: testA.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 testA = new Netbox.ContactGroup("test_a", new()
{
Name = "test-contact-group-a",
Description = "test-description",
});
var testB = new Netbox.ContactGroup("test_b", new()
{
Name = "test-contact-group-b",
ParentId = testA.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 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 testA = new ContactGroup("testA", ContactGroupArgs.builder()
.name("test-contact-group-a")
.description("test-description")
.build());
var testB = new ContactGroup("testB", ContactGroupArgs.builder()
.name("test-contact-group-b")
.parentId(testA.contactGroupId())
.build());
}
}
resources:
testA:
type: netbox:ContactGroup
name: test_a
properties:
name: test-contact-group-a
description: test-description
testB:
type: netbox:ContactGroup
name: test_b
properties:
name: test-contact-group-b
parentId: ${testA.contactGroupId}
Example coming soon!
Create ContactGroup Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ContactGroup(name: string, args?: ContactGroupArgs, opts?: CustomResourceOptions);@overload
def ContactGroup(resource_name: str,
args: Optional[ContactGroupArgs] = None,
opts: Optional[ResourceOptions] = None)
@overload
def ContactGroup(resource_name: str,
opts: Optional[ResourceOptions] = None,
comments: Optional[str] = None,
custom_fields: Optional[Mapping[str, str]] = None,
description: Optional[str] = None,
name: Optional[str] = None,
owner_id: Optional[float] = None,
parent_id: Optional[float] = None,
slug: Optional[str] = None,
tags: Optional[Sequence[str]] = None)func NewContactGroup(ctx *Context, name string, args *ContactGroupArgs, opts ...ResourceOption) (*ContactGroup, error)public ContactGroup(string name, ContactGroupArgs? args = null, CustomResourceOptions? opts = null)
public ContactGroup(String name, ContactGroupArgs args)
public ContactGroup(String name, ContactGroupArgs args, CustomResourceOptions options)
type: netbox:ContactGroup
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
resource "netbox_contact_group" "name" {
# resource properties
}Parameters
- name string
- The unique name of the resource.
- args ContactGroupArgs
- 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 ContactGroupArgs
- 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 ContactGroupArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ContactGroupArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ContactGroupArgs
- 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 contactGroupResource = new Netbox.ContactGroup("contactGroupResource", new()
{
Comments = "string",
CustomFields =
{
{ "string", "string" },
},
Description = "string",
Name = "string",
OwnerId = 0.0,
ParentId = 0.0,
Slug = "string",
Tags = new[]
{
"string",
},
});
example, err := netbox.NewContactGroup(ctx, "contactGroupResource", &netbox.ContactGroupArgs{
Comments: pulumi.String("string"),
CustomFields: pulumi.StringMap{
"string": pulumi.String("string"),
},
Description: pulumi.String("string"),
Name: pulumi.String("string"),
OwnerId: pulumi.Float64(0),
ParentId: pulumi.Float64(0),
Slug: pulumi.String("string"),
Tags: pulumi.StringArray{
pulumi.String("string"),
},
})
resource "netbox_contact_group" "contactGroupResource" {
lifecycle {
create_before_destroy = true
}
comments = "string"
custom_fields = {
"string" = "string"
}
description = "string"
name = "string"
owner_id = 0
parent_id = 0
slug = "string"
tags = ["string"]
}
var contactGroupResource = new ContactGroup("contactGroupResource", ContactGroupArgs.builder()
.comments("string")
.customFields(Map.of("string", "string"))
.description("string")
.name("string")
.ownerId(0.0)
.parentId(0.0)
.slug("string")
.tags("string")
.build());
contact_group_resource = netbox.ContactGroup("contactGroupResource",
comments="string",
custom_fields={
"string": "string",
},
description="string",
name="string",
owner_id=float(0),
parent_id=float(0),
slug="string",
tags=["string"])
const contactGroupResource = new netbox.ContactGroup("contactGroupResource", {
comments: "string",
customFields: {
string: "string",
},
description: "string",
name: "string",
ownerId: 0,
parentId: 0,
slug: "string",
tags: ["string"],
});
type: netbox:ContactGroup
properties:
comments: string
customFields:
string: string
description: string
name: string
ownerId: 0
parentId: 0
slug: string
tags:
- string
ContactGroup 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 ContactGroup resource accepts the following input properties:
- 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
- Name string
- Owner
Id double - Id of the owner the object is assigned to.
- Parent
Id double - Id of the parent contact group.
- Slug string
- URL-friendly unique shorthand; derived from name when not set.
- List<string>
- Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
- 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
- Name string
- Owner
Id float64 - Id of the owner the object is assigned to.
- Parent
Id float64 - Id of the parent contact group.
- Slug string
- URL-friendly unique shorthand; derived from name when not set.
- []string
- Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
- comments string
- custom_
fields map(string) - Custom field values by field name. Every value is a string; NetBox coerces numbers and booleans. An object field holds the related object's id, e.g. "12", a multiobject field a JSON list of ids in any order, e.g. jsonencode([12, 13]). A key removed from the map is cleared in NetBox (set {} to clear all).
- description string
- name string
- owner_
id number - Id of the owner the object is assigned to.
- parent_
id number - Id of the parent contact group.
- slug string
- URL-friendly unique shorthand; derived from name when not set.
- list(string)
- Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
- 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
- name String
- owner
Id Double - Id of the owner the object is assigned to.
- parent
Id Double - Id of the parent contact group.
- slug String
- URL-friendly unique shorthand; derived from name when not set.
- List<String>
- Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
- 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
- name string
- owner
Id number - Id of the owner the object is assigned to.
- parent
Id number - Id of the parent contact group.
- slug string
- URL-friendly unique shorthand; derived from name when not set.
- string[]
- Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
- comments str
- custom_
fields Mapping[str, str] - Custom field values by field name. Every value is a string; NetBox coerces numbers and booleans. An object field holds the related object's id, e.g. "12", a multiobject field a JSON list of ids in any order, e.g. jsonencode([12, 13]). A key removed from the map is cleared in NetBox (set {} to clear all).
- description str
- name str
- owner_
id float - Id of the owner the object is assigned to.
- parent_
id float - Id of the parent contact group.
- slug str
- URL-friendly unique shorthand; derived from name when not set.
- Sequence[str]
- Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
- comments String
- custom
Fields Map<String> - Custom field values by field name. Every value is a string; NetBox coerces numbers and booleans. An object field holds the related object's id, e.g. "12", a multiobject field a JSON list of ids in any order, e.g. jsonencode([12, 13]). A key removed from the map is cleared in NetBox (set {} to clear all).
- description String
- name String
- owner
Id Number - Id of the owner the object is assigned to.
- parent
Id Number - Id of the parent contact group.
- slug String
- URL-friendly unique shorthand; derived from name when not set.
- List<String>
- Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
Outputs
All input properties are implicitly available as output properties. Additionally, the ContactGroup resource produces the following output properties:
- Contact
Count double - Number of contacts in the group.
- Contact
Group doubleId - 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
Count float64 - Number of contacts in the group.
- Contact
Group float64Id - 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_
count number - Number of contacts in the group.
- contact_
group_ numberid - 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
Count Double - Number of contacts in the group.
- contact
Group DoubleId - 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
Count number - Number of contacts in the group.
- contact
Group numberId - 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_
count float - Number of contacts in the group.
- contact_
group_ floatid - 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
Count Number - Number of contacts in the group.
- contact
Group NumberId - 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 ContactGroup Resource
Get an existing ContactGroup 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?: ContactGroupState, opts?: CustomResourceOptions): ContactGroup@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
comments: Optional[str] = None,
contact_count: Optional[float] = None,
contact_group_id: Optional[float] = None,
created: Optional[str] = None,
custom_fields: Optional[Mapping[str, str]] = None,
description: Optional[str] = None,
last_updated: Optional[str] = None,
name: Optional[str] = None,
owner_id: Optional[float] = None,
parent_id: Optional[float] = None,
slug: Optional[str] = None,
tags: Optional[Sequence[str]] = None,
tags_alls: Optional[Sequence[str]] = None,
url: Optional[str] = None) -> ContactGroupfunc GetContactGroup(ctx *Context, name string, id IDInput, state *ContactGroupState, opts ...ResourceOption) (*ContactGroup, error)public static ContactGroup Get(string name, Input<string> id, ContactGroupState? state, CustomResourceOptions? opts = null)public static ContactGroup get(String name, Output<String> id, ContactGroupState state, CustomResourceOptions options)resources: existingContactGroup: type: netbox:ContactGroup get: id: ${id}import {
to = netbox_contact_group.example
id = "${id}"
}
- name string
- The unique name of the resulting resource.
- id Input<ID>
- The unique provider ID of the resource to look up.
- state ContactGroupState
- Known property values the provider needs, along with the ID, to find the resource. Usually not required.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resulting resource.
- id str
- The unique provider ID of the resource to look up.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resulting resource.
- id IDInput
- The unique provider ID of the resource to look up.
- state ContactGroupState
- Known property values the provider needs, along with the ID, to find the resource. Usually not required.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resulting resource.
- id Input<string>
- The unique provider ID of the resource to look up.
- state ContactGroupState
- Known property values the provider needs, along with the ID, to find the resource. Usually not required.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resulting resource.
- id Output<String>
- The unique provider ID of the resource to look up.
- state ContactGroupState
- Known property values the provider needs, along with the ID, to find the resource. Usually not required.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
- Comments string
- Contact
Count double - Number of contacts in the group.
- Contact
Group doubleId - 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
- Last
Updated string - Name string
- Owner
Id double - Id of the owner the object is assigned to.
- Parent
Id double - Id of the parent contact group.
- Slug string
- URL-friendly unique shorthand; derived from name when not set.
- 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
- Comments string
- Contact
Count float64 - Number of contacts in the group.
- Contact
Group float64Id - 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
- Last
Updated string - Name string
- Owner
Id float64 - Id of the owner the object is assigned to.
- Parent
Id float64 - Id of the parent contact group.
- Slug string
- URL-friendly unique shorthand; derived from name when not set.
- []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
- comments string
- contact_
count number - Number of contacts in the group.
- contact_
group_ numberid - 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
- last_
updated string - name string
- owner_
id number - Id of the owner the object is assigned to.
- parent_
id number - Id of the parent contact group.
- slug string
- URL-friendly unique shorthand; derived from name when not set.
- 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
- comments String
- contact
Count Double - Number of contacts in the group.
- contact
Group DoubleId - 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
- last
Updated String - name String
- owner
Id Double - Id of the owner the object is assigned to.
- parent
Id Double - Id of the parent contact group.
- slug String
- URL-friendly unique shorthand; derived from name when not set.
- 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
- comments string
- contact
Count number - Number of contacts in the group.
- contact
Group numberId - 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
- last
Updated string - name string
- owner
Id number - Id of the owner the object is assigned to.
- parent
Id number - Id of the parent contact group.
- slug string
- URL-friendly unique shorthand; derived from name when not set.
- 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
- comments str
- contact_
count float - Number of contacts in the group.
- contact_
group_ floatid - 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
- last_
updated str - name str
- owner_
id float - Id of the owner the object is assigned to.
- parent_
id float - Id of the parent contact group.
- slug str
- URL-friendly unique shorthand; derived from name when not set.
- 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
- comments String
- contact
Count Number - Number of contacts in the group.
- contact
Group NumberId - 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
- last
Updated String - name String
- owner
Id Number - Id of the owner the object is assigned to.
- parent
Id Number - Id of the parent contact group.
- slug String
- URL-friendly unique shorthand; derived from name when not set.
- 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
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_group.test
id = “123”
}
The pulumi import command can be used, for example:
$ pulumi import netbox:index/contactGroup:ContactGroup 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 Monday, Nov 16, 2026 by e-breuninger