published on Wednesday, Nov 4, 2026 by e-breuninger
published on Wednesday, Nov 4, 2026 by e-breuninger
A custom link rendered on the pages of the object types it applies to (extras.customlink).
From the official documentation:
Users can add custom links to object views in NetBox to reference external resources. For example, you might create a custom link for devices pointing to a monitoring system. See the custom links documentation for more information.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as netbox from "@pulumi/netbox";
const test = new netbox.CustomLink("test", {
name: "test-custom-link",
objectTypes: [
"dcim.device",
"dcim.site",
],
linkText: "Open {{ object.name }}",
linkUrl: "https://example.com/test/{{ object.pk }}",
enabled: true,
weight: 100,
groupName: "test-group",
buttonClass: "blue",
newWindow: true,
});
import pulumi
import pulumi_netbox as netbox
test = netbox.CustomLink("test",
name="test-custom-link",
object_types=[
"dcim.device",
"dcim.site",
],
link_text="Open {{ object.name }}",
link_url="https://example.com/test/{{ object.pk }}",
enabled=True,
weight=100,
group_name="test-group",
button_class="blue",
new_window=True)
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/netbox/v6/netbox"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := netbox.NewCustomLink(ctx, "test", &netbox.CustomLinkArgs{
Name: pulumi.String("test-custom-link"),
ObjectTypes: pulumi.StringArray{
pulumi.String("dcim.device"),
pulumi.String("dcim.site"),
},
LinkText: pulumi.String("Open {{ object.name }}"),
LinkUrl: pulumi.String("https://example.com/test/{{ object.pk }}"),
Enabled: pulumi.Bool(true),
Weight: pulumi.Float64(100),
GroupName: pulumi.String("test-group"),
ButtonClass: pulumi.String("blue"),
NewWindow: pulumi.Bool(true),
})
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.CustomLink("test", new()
{
Name = "test-custom-link",
ObjectTypes = new[]
{
"dcim.device",
"dcim.site",
},
LinkText = "Open {{ object.name }}",
LinkUrl = "https://example.com/test/{{ object.pk }}",
Enabled = true,
Weight = 100,
GroupName = "test-group",
ButtonClass = "blue",
NewWindow = true,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.netbox.CustomLink;
import com.pulumi.netbox.CustomLinkArgs;
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 CustomLink("test", CustomLinkArgs.builder()
.name("test-custom-link")
.objectTypes(
"dcim.device",
"dcim.site")
.linkText("Open {{ object.name }}")
.linkUrl("https://example.com/test/{{ object.pk }}")
.enabled(true)
.weight(100.0)
.groupName("test-group")
.buttonClass("blue")
.newWindow(true)
.build());
}
}
resources:
test:
type: netbox:CustomLink
properties:
name: test-custom-link
objectTypes:
- dcim.device
- dcim.site
linkText: Open {{ object.name }}
linkUrl: https://example.com/test/{{ object.pk }}
enabled: true
weight: 100
groupName: test-group
buttonClass: blue
newWindow: true
Example coming soon!
Create CustomLink Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new CustomLink(name: string, args: CustomLinkArgs, opts?: CustomResourceOptions);@overload
def CustomLink(resource_name: str,
args: CustomLinkArgs,
opts: Optional[ResourceOptions] = None)
@overload
def CustomLink(resource_name: str,
opts: Optional[ResourceOptions] = None,
link_text: Optional[str] = None,
link_url: Optional[str] = None,
object_types: Optional[Sequence[str]] = None,
button_class: Optional[str] = None,
enabled: Optional[bool] = None,
group_name: Optional[str] = None,
name: Optional[str] = None,
new_window: Optional[bool] = None,
owner_id: Optional[float] = None,
weight: Optional[float] = None)func NewCustomLink(ctx *Context, name string, args CustomLinkArgs, opts ...ResourceOption) (*CustomLink, error)public CustomLink(string name, CustomLinkArgs args, CustomResourceOptions? opts = null)
public CustomLink(String name, CustomLinkArgs args)
public CustomLink(String name, CustomLinkArgs args, CustomResourceOptions options)
type: netbox:CustomLink
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
resource "netbox_custom_link" "name" {
# resource properties
}Parameters
- name string
- The unique name of the resource.
- args CustomLinkArgs
- 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 CustomLinkArgs
- 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 CustomLinkArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args CustomLinkArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args CustomLinkArgs
- 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 customLinkResource = new Netbox.CustomLink("customLinkResource", new()
{
LinkText = "string",
LinkUrl = "string",
ObjectTypes = new[]
{
"string",
},
ButtonClass = "string",
Enabled = false,
GroupName = "string",
Name = "string",
NewWindow = false,
OwnerId = 0.0,
Weight = 0.0,
});
example, err := netbox.NewCustomLink(ctx, "customLinkResource", &netbox.CustomLinkArgs{
LinkText: pulumi.String("string"),
LinkUrl: pulumi.String("string"),
ObjectTypes: pulumi.StringArray{
pulumi.String("string"),
},
ButtonClass: pulumi.String("string"),
Enabled: pulumi.Bool(false),
GroupName: pulumi.String("string"),
Name: pulumi.String("string"),
NewWindow: pulumi.Bool(false),
OwnerId: pulumi.Float64(0),
Weight: pulumi.Float64(0),
})
resource "netbox_custom_link" "customLinkResource" {
lifecycle {
create_before_destroy = true
}
link_text = "string"
link_url = "string"
object_types = ["string"]
button_class = "string"
enabled = false
group_name = "string"
name = "string"
new_window = false
owner_id = 0
weight = 0
}
var customLinkResource = new CustomLink("customLinkResource", CustomLinkArgs.builder()
.linkText("string")
.linkUrl("string")
.objectTypes("string")
.buttonClass("string")
.enabled(false)
.groupName("string")
.name("string")
.newWindow(false)
.ownerId(0.0)
.weight(0.0)
.build());
custom_link_resource = netbox.CustomLink("customLinkResource",
link_text="string",
link_url="string",
object_types=["string"],
button_class="string",
enabled=False,
group_name="string",
name="string",
new_window=False,
owner_id=float(0),
weight=float(0))
const customLinkResource = new netbox.CustomLink("customLinkResource", {
linkText: "string",
linkUrl: "string",
objectTypes: ["string"],
buttonClass: "string",
enabled: false,
groupName: "string",
name: "string",
newWindow: false,
ownerId: 0,
weight: 0,
});
type: netbox:CustomLink
properties:
buttonClass: string
enabled: false
groupName: string
linkText: string
linkUrl: string
name: string
newWindow: false
objectTypes:
- string
ownerId: 0
weight: 0
CustomLink 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 CustomLink resource accepts the following input properties:
- Link
Text string - Jinja2 template for the link text; the object is available as {{ object }}.
- Link
Url string - Jinja2 template for the link URL; the object is available as {{ object }}.
- Object
Types List<string> - Object types the link is shown on, as app-labelled content types (dcim.device).
- string
- Button style. One of: default, blue, indigo, purple, pink, red, orange, yellow, green, teal, cyan, gray, black, white, ghost-dark.
- Enabled bool
- Whether the link is rendered.
- Group
Name string - Links with the same group name are rendered as a dropdown.
- Name string
- New
Window bool - Open the link in a new browser window.
- Owner
Id double - Id of the owner the object is assigned to.
- Weight double
- Order within the group. Must be a whole number.
- Link
Text string - Jinja2 template for the link text; the object is available as {{ object }}.
- Link
Url string - Jinja2 template for the link URL; the object is available as {{ object }}.
- Object
Types []string - Object types the link is shown on, as app-labelled content types (dcim.device).
- string
- Button style. One of: default, blue, indigo, purple, pink, red, orange, yellow, green, teal, cyan, gray, black, white, ghost-dark.
- Enabled bool
- Whether the link is rendered.
- Group
Name string - Links with the same group name are rendered as a dropdown.
- Name string
- New
Window bool - Open the link in a new browser window.
- Owner
Id float64 - Id of the owner the object is assigned to.
- Weight float64
- Order within the group. Must be a whole number.
- link_
text string - Jinja2 template for the link text; the object is available as {{ object }}.
- link_
url string - Jinja2 template for the link URL; the object is available as {{ object }}.
- object_
types list(string) - Object types the link is shown on, as app-labelled content types (dcim.device).
- string
- Button style. One of: default, blue, indigo, purple, pink, red, orange, yellow, green, teal, cyan, gray, black, white, ghost-dark.
- enabled bool
- Whether the link is rendered.
- group_
name string - Links with the same group name are rendered as a dropdown.
- name string
- new_
window bool - Open the link in a new browser window.
- owner_
id number - Id of the owner the object is assigned to.
- weight number
- Order within the group. Must be a whole number.
- link
Text String - Jinja2 template for the link text; the object is available as {{ object }}.
- link
Url String - Jinja2 template for the link URL; the object is available as {{ object }}.
- object
Types List<String> - Object types the link is shown on, as app-labelled content types (dcim.device).
- String
- Button style. One of: default, blue, indigo, purple, pink, red, orange, yellow, green, teal, cyan, gray, black, white, ghost-dark.
- enabled Boolean
- Whether the link is rendered.
- group
Name String - Links with the same group name are rendered as a dropdown.
- name String
- new
Window Boolean - Open the link in a new browser window.
- owner
Id Double - Id of the owner the object is assigned to.
- weight Double
- Order within the group. Must be a whole number.
- link
Text string - Jinja2 template for the link text; the object is available as {{ object }}.
- link
Url string - Jinja2 template for the link URL; the object is available as {{ object }}.
- object
Types string[] - Object types the link is shown on, as app-labelled content types (dcim.device).
- string
- Button style. One of: default, blue, indigo, purple, pink, red, orange, yellow, green, teal, cyan, gray, black, white, ghost-dark.
- enabled boolean
- Whether the link is rendered.
- group
Name string - Links with the same group name are rendered as a dropdown.
- name string
- new
Window boolean - Open the link in a new browser window.
- owner
Id number - Id of the owner the object is assigned to.
- weight number
- Order within the group. Must be a whole number.
- link_
text str - Jinja2 template for the link text; the object is available as {{ object }}.
- link_
url str - Jinja2 template for the link URL; the object is available as {{ object }}.
- object_
types Sequence[str] - Object types the link is shown on, as app-labelled content types (dcim.device).
- str
- Button style. One of: default, blue, indigo, purple, pink, red, orange, yellow, green, teal, cyan, gray, black, white, ghost-dark.
- enabled bool
- Whether the link is rendered.
- group_
name str - Links with the same group name are rendered as a dropdown.
- name str
- new_
window bool - Open the link in a new browser window.
- owner_
id float - Id of the owner the object is assigned to.
- weight float
- Order within the group. Must be a whole number.
- link
Text String - Jinja2 template for the link text; the object is available as {{ object }}.
- link
Url String - Jinja2 template for the link URL; the object is available as {{ object }}.
- object
Types List<String> - Object types the link is shown on, as app-labelled content types (dcim.device).
- String
- Button style. One of: default, blue, indigo, purple, pink, red, orange, yellow, green, teal, cyan, gray, black, white, ghost-dark.
- enabled Boolean
- Whether the link is rendered.
- group
Name String - Links with the same group name are rendered as a dropdown.
- name String
- new
Window Boolean - Open the link in a new browser window.
- owner
Id Number - Id of the owner the object is assigned to.
- weight Number
- Order within the group. Must be a whole number.
Outputs
All input properties are implicitly available as output properties. Additionally, the CustomLink resource produces the following output properties:
- Created string
- Custom
Link doubleId - NetBox id.
- Id string
- The provider-assigned unique ID for this managed resource.
- Last
Updated string - Url string
- Created string
- Custom
Link float64Id - NetBox id.
- Id string
- The provider-assigned unique ID for this managed resource.
- Last
Updated string - Url string
- created string
- custom_
link_ numberid - NetBox id.
- id string
- The provider-assigned unique ID for this managed resource.
- last_
updated string - url string
- created String
- custom
Link DoubleId - NetBox id.
- id String
- The provider-assigned unique ID for this managed resource.
- last
Updated String - url String
- created string
- custom
Link numberId - NetBox id.
- id string
- The provider-assigned unique ID for this managed resource.
- last
Updated string - url string
- created str
- custom_
link_ floatid - NetBox id.
- id str
- The provider-assigned unique ID for this managed resource.
- last_
updated str - url str
- created String
- custom
Link NumberId - NetBox id.
- id String
- The provider-assigned unique ID for this managed resource.
- last
Updated String - url String
Look up Existing CustomLink Resource
Get an existing CustomLink 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?: CustomLinkState, opts?: CustomResourceOptions): CustomLink@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
button_class: Optional[str] = None,
created: Optional[str] = None,
custom_link_id: Optional[float] = None,
enabled: Optional[bool] = None,
group_name: Optional[str] = None,
last_updated: Optional[str] = None,
link_text: Optional[str] = None,
link_url: Optional[str] = None,
name: Optional[str] = None,
new_window: Optional[bool] = None,
object_types: Optional[Sequence[str]] = None,
owner_id: Optional[float] = None,
url: Optional[str] = None,
weight: Optional[float] = None) -> CustomLinkfunc GetCustomLink(ctx *Context, name string, id IDInput, state *CustomLinkState, opts ...ResourceOption) (*CustomLink, error)public static CustomLink Get(string name, Input<string> id, CustomLinkState? state, CustomResourceOptions? opts = null)public static CustomLink get(String name, Output<String> id, CustomLinkState state, CustomResourceOptions options)resources: _: type: netbox:CustomLink get: id: ${id}import {
to = netbox_custom_link.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.
- string
- Button style. One of: default, blue, indigo, purple, pink, red, orange, yellow, green, teal, cyan, gray, black, white, ghost-dark.
- Created string
- Custom
Link doubleId - NetBox id.
- Enabled bool
- Whether the link is rendered.
- Group
Name string - Links with the same group name are rendered as a dropdown.
- Last
Updated string - Link
Text string - Jinja2 template for the link text; the object is available as {{ object }}.
- Link
Url string - Jinja2 template for the link URL; the object is available as {{ object }}.
- Name string
- New
Window bool - Open the link in a new browser window.
- Object
Types List<string> - Object types the link is shown on, as app-labelled content types (dcim.device).
- Owner
Id double - Id of the owner the object is assigned to.
- Url string
- Weight double
- Order within the group. Must be a whole number.
- string
- Button style. One of: default, blue, indigo, purple, pink, red, orange, yellow, green, teal, cyan, gray, black, white, ghost-dark.
- Created string
- Custom
Link float64Id - NetBox id.
- Enabled bool
- Whether the link is rendered.
- Group
Name string - Links with the same group name are rendered as a dropdown.
- Last
Updated string - Link
Text string - Jinja2 template for the link text; the object is available as {{ object }}.
- Link
Url string - Jinja2 template for the link URL; the object is available as {{ object }}.
- Name string
- New
Window bool - Open the link in a new browser window.
- Object
Types []string - Object types the link is shown on, as app-labelled content types (dcim.device).
- Owner
Id float64 - Id of the owner the object is assigned to.
- Url string
- Weight float64
- Order within the group. Must be a whole number.
- string
- Button style. One of: default, blue, indigo, purple, pink, red, orange, yellow, green, teal, cyan, gray, black, white, ghost-dark.
- created string
- custom_
link_ numberid - NetBox id.
- enabled bool
- Whether the link is rendered.
- group_
name string - Links with the same group name are rendered as a dropdown.
- last_
updated string - link_
text string - Jinja2 template for the link text; the object is available as {{ object }}.
- link_
url string - Jinja2 template for the link URL; the object is available as {{ object }}.
- name string
- new_
window bool - Open the link in a new browser window.
- object_
types list(string) - Object types the link is shown on, as app-labelled content types (dcim.device).
- owner_
id number - Id of the owner the object is assigned to.
- url string
- weight number
- Order within the group. Must be a whole number.
- String
- Button style. One of: default, blue, indigo, purple, pink, red, orange, yellow, green, teal, cyan, gray, black, white, ghost-dark.
- created String
- custom
Link DoubleId - NetBox id.
- enabled Boolean
- Whether the link is rendered.
- group
Name String - Links with the same group name are rendered as a dropdown.
- last
Updated String - link
Text String - Jinja2 template for the link text; the object is available as {{ object }}.
- link
Url String - Jinja2 template for the link URL; the object is available as {{ object }}.
- name String
- new
Window Boolean - Open the link in a new browser window.
- object
Types List<String> - Object types the link is shown on, as app-labelled content types (dcim.device).
- owner
Id Double - Id of the owner the object is assigned to.
- url String
- weight Double
- Order within the group. Must be a whole number.
- string
- Button style. One of: default, blue, indigo, purple, pink, red, orange, yellow, green, teal, cyan, gray, black, white, ghost-dark.
- created string
- custom
Link numberId - NetBox id.
- enabled boolean
- Whether the link is rendered.
- group
Name string - Links with the same group name are rendered as a dropdown.
- last
Updated string - link
Text string - Jinja2 template for the link text; the object is available as {{ object }}.
- link
Url string - Jinja2 template for the link URL; the object is available as {{ object }}.
- name string
- new
Window boolean - Open the link in a new browser window.
- object
Types string[] - Object types the link is shown on, as app-labelled content types (dcim.device).
- owner
Id number - Id of the owner the object is assigned to.
- url string
- weight number
- Order within the group. Must be a whole number.
- str
- Button style. One of: default, blue, indigo, purple, pink, red, orange, yellow, green, teal, cyan, gray, black, white, ghost-dark.
- created str
- custom_
link_ floatid - NetBox id.
- enabled bool
- Whether the link is rendered.
- group_
name str - Links with the same group name are rendered as a dropdown.
- last_
updated str - link_
text str - Jinja2 template for the link text; the object is available as {{ object }}.
- link_
url str - Jinja2 template for the link URL; the object is available as {{ object }}.
- name str
- new_
window bool - Open the link in a new browser window.
- object_
types Sequence[str] - Object types the link is shown on, as app-labelled content types (dcim.device).
- owner_
id float - Id of the owner the object is assigned to.
- url str
- weight float
- Order within the group. Must be a whole number.
- String
- Button style. One of: default, blue, indigo, purple, pink, red, orange, yellow, green, teal, cyan, gray, black, white, ghost-dark.
- created String
- custom
Link NumberId - NetBox id.
- enabled Boolean
- Whether the link is rendered.
- group
Name String - Links with the same group name are rendered as a dropdown.
- last
Updated String - link
Text String - Jinja2 template for the link text; the object is available as {{ object }}.
- link
Url String - Jinja2 template for the link URL; the object is available as {{ object }}.
- name String
- new
Window Boolean - Open the link in a new browser window.
- object
Types List<String> - Object types the link is shown on, as app-labelled content types (dcim.device).
- owner
Id Number - Id of the owner the object is assigned to.
- url String
- weight Number
- Order within the group. Must be a whole number.
Import
In Terraform v1.5.0 and later, the import block can be used with the id attribute, for example:
terraform
import {
to = netbox_custom_link.test
id = “123”
}
The pulumi import command can be used, for example:
$ pulumi import netbox:index/customLink:CustomLink 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