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

    A 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:

    LinkText string
    Jinja2 template for the link text; the object is available as {{ object }}.
    LinkUrl string
    Jinja2 template for the link URL; the object is available as {{ object }}.
    ObjectTypes List<string>
    Object types the link is shown on, as app-labelled content types (dcim.device).
    ButtonClass 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.
    GroupName string
    Links with the same group name are rendered as a dropdown.
    Name string
    NewWindow bool
    Open the link in a new browser window.
    OwnerId double
    Id of the owner the object is assigned to.
    Weight double
    Order within the group. Must be a whole number.
    LinkText string
    Jinja2 template for the link text; the object is available as {{ object }}.
    LinkUrl string
    Jinja2 template for the link URL; the object is available as {{ object }}.
    ObjectTypes []string
    Object types the link is shown on, as app-labelled content types (dcim.device).
    ButtonClass 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.
    GroupName string
    Links with the same group name are rendered as a dropdown.
    Name string
    NewWindow bool
    Open the link in a new browser window.
    OwnerId 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).
    button_class 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.
    linkText String
    Jinja2 template for the link text; the object is available as {{ object }}.
    linkUrl String
    Jinja2 template for the link URL; the object is available as {{ object }}.
    objectTypes List<String>
    Object types the link is shown on, as app-labelled content types (dcim.device).
    buttonClass 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.
    groupName String
    Links with the same group name are rendered as a dropdown.
    name String
    newWindow Boolean
    Open the link in a new browser window.
    ownerId Double
    Id of the owner the object is assigned to.
    weight Double
    Order within the group. Must be a whole number.
    linkText string
    Jinja2 template for the link text; the object is available as {{ object }}.
    linkUrl string
    Jinja2 template for the link URL; the object is available as {{ object }}.
    objectTypes string[]
    Object types the link is shown on, as app-labelled content types (dcim.device).
    buttonClass 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.
    groupName string
    Links with the same group name are rendered as a dropdown.
    name string
    newWindow boolean
    Open the link in a new browser window.
    ownerId 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).
    button_class 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.
    linkText String
    Jinja2 template for the link text; the object is available as {{ object }}.
    linkUrl String
    Jinja2 template for the link URL; the object is available as {{ object }}.
    objectTypes List<String>
    Object types the link is shown on, as app-labelled content types (dcim.device).
    buttonClass 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.
    groupName String
    Links with the same group name are rendered as a dropdown.
    name String
    newWindow Boolean
    Open the link in a new browser window.
    ownerId 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
    CustomLinkId double
    NetBox id.
    Id string
    The provider-assigned unique ID for this managed resource.
    LastUpdated string
    Url string
    Created string
    CustomLinkId float64
    NetBox id.
    Id string
    The provider-assigned unique ID for this managed resource.
    LastUpdated string
    Url string
    created string
    custom_link_id number
    NetBox id.
    id string
    The provider-assigned unique ID for this managed resource.
    last_updated string
    url string
    created String
    customLinkId Double
    NetBox id.
    id String
    The provider-assigned unique ID for this managed resource.
    lastUpdated String
    url String
    created string
    customLinkId number
    NetBox id.
    id string
    The provider-assigned unique ID for this managed resource.
    lastUpdated string
    url string
    created str
    custom_link_id float
    NetBox id.
    id str
    The provider-assigned unique ID for this managed resource.
    last_updated str
    url str
    created String
    customLinkId Number
    NetBox id.
    id String
    The provider-assigned unique ID for this managed resource.
    lastUpdated 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) -> CustomLink
    func 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.
    The following state arguments are supported:
    ButtonClass string
    Button style. One of: default, blue, indigo, purple, pink, red, orange, yellow, green, teal, cyan, gray, black, white, ghost-dark.
    Created string
    CustomLinkId double
    NetBox id.
    Enabled bool
    Whether the link is rendered.
    GroupName string
    Links with the same group name are rendered as a dropdown.
    LastUpdated string
    LinkText string
    Jinja2 template for the link text; the object is available as {{ object }}.
    LinkUrl string
    Jinja2 template for the link URL; the object is available as {{ object }}.
    Name string
    NewWindow bool
    Open the link in a new browser window.
    ObjectTypes List<string>
    Object types the link is shown on, as app-labelled content types (dcim.device).
    OwnerId double
    Id of the owner the object is assigned to.
    Url string
    Weight double
    Order within the group. Must be a whole number.
    ButtonClass string
    Button style. One of: default, blue, indigo, purple, pink, red, orange, yellow, green, teal, cyan, gray, black, white, ghost-dark.
    Created string
    CustomLinkId float64
    NetBox id.
    Enabled bool
    Whether the link is rendered.
    GroupName string
    Links with the same group name are rendered as a dropdown.
    LastUpdated string
    LinkText string
    Jinja2 template for the link text; the object is available as {{ object }}.
    LinkUrl string
    Jinja2 template for the link URL; the object is available as {{ object }}.
    Name string
    NewWindow bool
    Open the link in a new browser window.
    ObjectTypes []string
    Object types the link is shown on, as app-labelled content types (dcim.device).
    OwnerId float64
    Id of the owner the object is assigned to.
    Url string
    Weight float64
    Order within the group. Must be a whole number.
    button_class 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_id number
    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.
    buttonClass String
    Button style. One of: default, blue, indigo, purple, pink, red, orange, yellow, green, teal, cyan, gray, black, white, ghost-dark.
    created String
    customLinkId Double
    NetBox id.
    enabled Boolean
    Whether the link is rendered.
    groupName String
    Links with the same group name are rendered as a dropdown.
    lastUpdated String
    linkText String
    Jinja2 template for the link text; the object is available as {{ object }}.
    linkUrl String
    Jinja2 template for the link URL; the object is available as {{ object }}.
    name String
    newWindow Boolean
    Open the link in a new browser window.
    objectTypes List<String>
    Object types the link is shown on, as app-labelled content types (dcim.device).
    ownerId Double
    Id of the owner the object is assigned to.
    url String
    weight Double
    Order within the group. Must be a whole number.
    buttonClass string
    Button style. One of: default, blue, indigo, purple, pink, red, orange, yellow, green, teal, cyan, gray, black, white, ghost-dark.
    created string
    customLinkId number
    NetBox id.
    enabled boolean
    Whether the link is rendered.
    groupName string
    Links with the same group name are rendered as a dropdown.
    lastUpdated string
    linkText string
    Jinja2 template for the link text; the object is available as {{ object }}.
    linkUrl string
    Jinja2 template for the link URL; the object is available as {{ object }}.
    name string
    newWindow boolean
    Open the link in a new browser window.
    objectTypes string[]
    Object types the link is shown on, as app-labelled content types (dcim.device).
    ownerId number
    Id of the owner the object is assigned to.
    url string
    weight number
    Order within the group. Must be a whole number.
    button_class 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_id float
    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.
    buttonClass String
    Button style. One of: default, blue, indigo, purple, pink, red, orange, yellow, green, teal, cyan, gray, black, white, ghost-dark.
    created String
    customLinkId Number
    NetBox id.
    enabled Boolean
    Whether the link is rendered.
    groupName String
    Links with the same group name are rendered as a dropdown.
    lastUpdated String
    linkText String
    Jinja2 template for the link text; the object is available as {{ object }}.
    linkUrl String
    Jinja2 template for the link URL; the object is available as {{ object }}.
    name String
    newWindow Boolean
    Open the link in a new browser window.
    objectTypes List<String>
    Object types the link is shown on, as app-labelled content types (dcim.device).
    ownerId 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 netbox Terraform Provider.
    netbox
    Viewing docs for netbox 6.0.0
    published on Wednesday, Nov 4, 2026 by e-breuninger

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial