1. Registry
  2. Packages
  3. Netbox Provider
  4. API Docs
  5. getDeviceRenderConfig
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

    The configuration NetBox renders for a device (dcim.device) from its config template, through the render-config endpoint. The template comes from the device, its role or its platform unless config_template_id names one.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as netbox from "@pulumi/netbox";
    
    const testSite = new netbox.Site("test", {name: "test-site"});
    const testManufacturer = new netbox.Manufacturer("test", {name: "test-manufacturer"});
    const testDeviceType = new netbox.DeviceType("test", {
        manufacturerId: testManufacturer.manufacturerId,
        model: "test-device-type",
    });
    const testDeviceRole = new netbox.DeviceRole("test", {name: "test-device-role"});
    const testConfigTemplate = new netbox.ConfigTemplate("test", {
        name: "test-config-template",
        templateCode: "hostname {{ device.name }}",
    });
    const testDevice = new netbox.Device("test", {
        name: "test-device",
        deviceTypeId: testDeviceType.deviceTypeId,
        roleId: testDeviceRole.deviceRoleId,
        siteId: testSite.siteId,
        configTemplateId: testConfigTemplate.configTemplateId,
    });
    const test = netbox.getDeviceRenderConfigOutput({
        deviceId: testDevice.deviceId,
    });
    
    import pulumi
    import pulumi_netbox as netbox
    
    test_site = netbox.Site("test", name="test-site")
    test_manufacturer = netbox.Manufacturer("test", name="test-manufacturer")
    test_device_type = netbox.DeviceType("test",
        manufacturer_id=test_manufacturer.manufacturer_id,
        model="test-device-type")
    test_device_role = netbox.DeviceRole("test", name="test-device-role")
    test_config_template = netbox.ConfigTemplate("test",
        name="test-config-template",
        template_code="hostname {{ device.name }}")
    test_device = netbox.Device("test",
        name="test-device",
        device_type_id=test_device_type.device_type_id,
        role_id=test_device_role.device_role_id,
        site_id=test_site.site_id,
        config_template_id=test_config_template.config_template_id)
    test = netbox.get_device_render_config_output(device_id=test_device.device_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 {
    		testSite, err := netbox.NewSite(ctx, "test", &netbox.SiteArgs{
    			Name: pulumi.String("test-site"),
    		})
    		if err != nil {
    			return err
    		}
    		testManufacturer, err := netbox.NewManufacturer(ctx, "test", &netbox.ManufacturerArgs{
    			Name: pulumi.String("test-manufacturer"),
    		})
    		if err != nil {
    			return err
    		}
    		testDeviceType, err := netbox.NewDeviceType(ctx, "test", &netbox.DeviceTypeArgs{
    			ManufacturerId: testManufacturer.ManufacturerId,
    			Model:          pulumi.String("test-device-type"),
    		})
    		if err != nil {
    			return err
    		}
    		testDeviceRole, err := netbox.NewDeviceRole(ctx, "test", &netbox.DeviceRoleArgs{
    			Name: pulumi.String("test-device-role"),
    		})
    		if err != nil {
    			return err
    		}
    		testConfigTemplate, err := netbox.NewConfigTemplate(ctx, "test", &netbox.ConfigTemplateArgs{
    			Name:         pulumi.String("test-config-template"),
    			TemplateCode: pulumi.String("hostname {{ device.name }}"),
    		})
    		if err != nil {
    			return err
    		}
    		testDevice, err := netbox.NewDevice(ctx, "test", &netbox.DeviceArgs{
    			Name:             pulumi.String("test-device"),
    			DeviceTypeId:     testDeviceType.DeviceTypeId,
    			RoleId:           testDeviceRole.DeviceRoleId,
    			SiteId:           testSite.SiteId,
    			ConfigTemplateId: testConfigTemplate.ConfigTemplateId,
    		})
    		if err != nil {
    			return err
    		}
    		_ = netbox.GetDeviceRenderConfigOutput(ctx, netbox.GetDeviceRenderConfigOutputArgs{
    			DeviceId: testDevice.DeviceId,
    		}, nil)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Netbox = Pulumi.Netbox;
    
    return await Deployment.RunAsync(() => 
    {
        var testSite = new Netbox.Site("test", new()
        {
            Name = "test-site",
        });
    
        var testManufacturer = new Netbox.Manufacturer("test", new()
        {
            Name = "test-manufacturer",
        });
    
        var testDeviceType = new Netbox.DeviceType("test", new()
        {
            ManufacturerId = testManufacturer.ManufacturerId,
            Model = "test-device-type",
        });
    
        var testDeviceRole = new Netbox.DeviceRole("test", new()
        {
            Name = "test-device-role",
        });
    
        var testConfigTemplate = new Netbox.ConfigTemplate("test", new()
        {
            Name = "test-config-template",
            TemplateCode = "hostname {{ device.name }}",
        });
    
        var testDevice = new Netbox.Device("test", new()
        {
            Name = "test-device",
            DeviceTypeId = testDeviceType.DeviceTypeId,
            RoleId = testDeviceRole.DeviceRoleId,
            SiteId = testSite.SiteId,
            ConfigTemplateId = testConfigTemplate.ConfigTemplateId,
        });
    
        var test = Netbox.GetDeviceRenderConfig.Invoke(new()
        {
            DeviceId = testDevice.DeviceId,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.netbox.Site;
    import com.pulumi.netbox.SiteArgs;
    import com.pulumi.netbox.Manufacturer;
    import com.pulumi.netbox.ManufacturerArgs;
    import com.pulumi.netbox.DeviceType;
    import com.pulumi.netbox.DeviceTypeArgs;
    import com.pulumi.netbox.DeviceRole;
    import com.pulumi.netbox.DeviceRoleArgs;
    import com.pulumi.netbox.ConfigTemplate;
    import com.pulumi.netbox.ConfigTemplateArgs;
    import com.pulumi.netbox.Device;
    import com.pulumi.netbox.DeviceArgs;
    import com.pulumi.netbox.NetboxFunctions;
    import com.pulumi.netbox.inputs.GetDeviceRenderConfigArgs;
    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 testSite = new Site("testSite", SiteArgs.builder()
                .name("test-site")
                .build());
    
            var testManufacturer = new Manufacturer("testManufacturer", ManufacturerArgs.builder()
                .name("test-manufacturer")
                .build());
    
            var testDeviceType = new DeviceType("testDeviceType", DeviceTypeArgs.builder()
                .manufacturerId(testManufacturer.manufacturerId())
                .model("test-device-type")
                .build());
    
            var testDeviceRole = new DeviceRole("testDeviceRole", DeviceRoleArgs.builder()
                .name("test-device-role")
                .build());
    
            var testConfigTemplate = new ConfigTemplate("testConfigTemplate", ConfigTemplateArgs.builder()
                .name("test-config-template")
                .templateCode("hostname {{ device.name }}")
                .build());
    
            var testDevice = new Device("testDevice", DeviceArgs.builder()
                .name("test-device")
                .deviceTypeId(testDeviceType.deviceTypeId())
                .roleId(testDeviceRole.deviceRoleId())
                .siteId(testSite.siteId())
                .configTemplateId(testConfigTemplate.configTemplateId())
                .build());
    
            final var test = NetboxFunctions.getDeviceRenderConfig(GetDeviceRenderConfigArgs.builder()
                .deviceId(testDevice.deviceId())
                .build());
    
        }
    }
    
    resources:
      testSite:
        type: netbox:Site
        name: test
        properties:
          name: test-site
      testManufacturer:
        type: netbox:Manufacturer
        name: test
        properties:
          name: test-manufacturer
      testDeviceType:
        type: netbox:DeviceType
        name: test
        properties:
          manufacturerId: ${testManufacturer.manufacturerId}
          model: test-device-type
      testDeviceRole:
        type: netbox:DeviceRole
        name: test
        properties:
          name: test-device-role
      testConfigTemplate:
        type: netbox:ConfigTemplate
        name: test
        properties:
          name: test-config-template
          templateCode: hostname {{ device.name }}
      testDevice:
        type: netbox:Device
        name: test
        properties:
          name: test-device
          deviceTypeId: ${testDeviceType.deviceTypeId}
          roleId: ${testDeviceRole.deviceRoleId}
          siteId: ${testSite.siteId}
          configTemplateId: ${testConfigTemplate.configTemplateId}
    variables:
      test:
        fn::invoke:
          function: netbox:getDeviceRenderConfig
          arguments:
            deviceId: ${testDevice.deviceId}
    
    Example coming soon!
    

    Using getDeviceRenderConfig

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getDeviceRenderConfig(args: GetDeviceRenderConfigArgs, opts?: InvokeOptions): Promise<GetDeviceRenderConfigResult>
    function getDeviceRenderConfigOutput(args: GetDeviceRenderConfigOutputArgs, opts?: InvokeOutputOptions): Output<GetDeviceRenderConfigResult>
    def get_device_render_config(config_template_id: Optional[float] = None,
                                 device_id: Optional[float] = None,
                                 opts: Optional[InvokeOptions] = None) -> GetDeviceRenderConfigResult
    def get_device_render_config_output(config_template_id: pulumi.Input[Optional[float]] = None,
                                 device_id: pulumi.Input[Optional[float]] = None,
                                 opts: Optional[InvokeOutputOptions] = None) -> Output[GetDeviceRenderConfigResult]
    func GetDeviceRenderConfig(ctx *Context, args *GetDeviceRenderConfigArgs, opts ...InvokeOption) (*GetDeviceRenderConfigResult, error)
    func GetDeviceRenderConfigOutput(ctx *Context, args *GetDeviceRenderConfigOutputArgs, opts ...InvokeOption) GetDeviceRenderConfigResultOutput

    > Note: This function is named GetDeviceRenderConfig in the Go SDK.

    public static class GetDeviceRenderConfig 
    {
        public static Task<GetDeviceRenderConfigResult> InvokeAsync(GetDeviceRenderConfigArgs args, InvokeOptions? opts = null)
        public static Output<GetDeviceRenderConfigResult> Invoke(GetDeviceRenderConfigInvokeArgs args, InvokeOptions? opts = null)
        public static Output<GetDeviceRenderConfigResult> Invoke(GetDeviceRenderConfigInvokeArgs args, InvokeOutputOptions opts)
    }
    public static CompletableFuture<GetDeviceRenderConfigResult> getDeviceRenderConfig(GetDeviceRenderConfigArgs args, InvokeOptions options)
    public static Output<GetDeviceRenderConfigResult> getDeviceRenderConfig(GetDeviceRenderConfigArgs args, InvokeOptions options)
    public static Output<GetDeviceRenderConfigResult> getDeviceRenderConfig(GetDeviceRenderConfigArgs args, InvokeOutputOptions options)
    
    fn::invoke:
      function: netbox:index/getDeviceRenderConfig:getDeviceRenderConfig
      arguments:
        # arguments dictionary
    data "netbox_get_device_render_config" "name" {
        # arguments
    }

    The following arguments are supported:

    DeviceId double
    Id of the device to render the configuration for.
    ConfigTemplateId double
    Id of the config template to render with. Unset renders with the template NetBox resolves for the device, and reads back as that template's id.
    DeviceId float64
    Id of the device to render the configuration for.
    ConfigTemplateId float64
    Id of the config template to render with. Unset renders with the template NetBox resolves for the device, and reads back as that template's id.
    device_id number
    Id of the device to render the configuration for.
    config_template_id number
    Id of the config template to render with. Unset renders with the template NetBox resolves for the device, and reads back as that template's id.
    deviceId Double
    Id of the device to render the configuration for.
    configTemplateId Double
    Id of the config template to render with. Unset renders with the template NetBox resolves for the device, and reads back as that template's id.
    deviceId number
    Id of the device to render the configuration for.
    configTemplateId number
    Id of the config template to render with. Unset renders with the template NetBox resolves for the device, and reads back as that template's id.
    device_id float
    Id of the device to render the configuration for.
    config_template_id float
    Id of the config template to render with. Unset renders with the template NetBox resolves for the device, and reads back as that template's id.
    deviceId Number
    Id of the device to render the configuration for.
    configTemplateId Number
    Id of the config template to render with. Unset renders with the template NetBox resolves for the device, and reads back as that template's id.

    getDeviceRenderConfig Result

    The following output properties are available:

    ConfigTemplateId double
    Id of the config template to render with. Unset renders with the template NetBox resolves for the device, and reads back as that template's id.
    ConfigTemplateName string
    Name of the config template the configuration was rendered with.
    Content string
    The rendered configuration.
    DeviceId double
    Id of the device to render the configuration for.
    Id string
    The provider-assigned unique ID for this managed resource.
    ConfigTemplateId float64
    Id of the config template to render with. Unset renders with the template NetBox resolves for the device, and reads back as that template's id.
    ConfigTemplateName string
    Name of the config template the configuration was rendered with.
    Content string
    The rendered configuration.
    DeviceId float64
    Id of the device to render the configuration for.
    Id string
    The provider-assigned unique ID for this managed resource.
    config_template_id number
    Id of the config template to render with. Unset renders with the template NetBox resolves for the device, and reads back as that template's id.
    config_template_name string
    Name of the config template the configuration was rendered with.
    content string
    The rendered configuration.
    device_id number
    Id of the device to render the configuration for.
    id string
    The provider-assigned unique ID for this managed resource.
    configTemplateId Double
    Id of the config template to render with. Unset renders with the template NetBox resolves for the device, and reads back as that template's id.
    configTemplateName String
    Name of the config template the configuration was rendered with.
    content String
    The rendered configuration.
    deviceId Double
    Id of the device to render the configuration for.
    id String
    The provider-assigned unique ID for this managed resource.
    configTemplateId number
    Id of the config template to render with. Unset renders with the template NetBox resolves for the device, and reads back as that template's id.
    configTemplateName string
    Name of the config template the configuration was rendered with.
    content string
    The rendered configuration.
    deviceId number
    Id of the device to render the configuration for.
    id string
    The provider-assigned unique ID for this managed resource.
    config_template_id float
    Id of the config template to render with. Unset renders with the template NetBox resolves for the device, and reads back as that template's id.
    config_template_name str
    Name of the config template the configuration was rendered with.
    content str
    The rendered configuration.
    device_id float
    Id of the device to render the configuration for.
    id str
    The provider-assigned unique ID for this managed resource.
    configTemplateId Number
    Id of the config template to render with. Unset renders with the template NetBox resolves for the device, and reads back as that template's id.
    configTemplateName String
    Name of the config template the configuration was rendered with.
    content String
    The rendered configuration.
    deviceId Number
    Id of the device to render the configuration for.
    id String
    The provider-assigned unique ID for this managed resource.

    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