1. Packages
  2. Netbox Provider
  3. API Docs
  4. getDeviceRenderConfig
netbox 5.1.0 published on Monday, Jan 26, 2026 by e-breuninger
netbox logo
netbox 5.1.0 published on Monday, Jan 26, 2026 by e-breuninger

    Render the configuration template assigned to a device using the device’s config context.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as netbox from "@pulumi/netbox";
    
    // Get the rendered configuration for a device
    const serverConfig = netbox.getDeviceRenderConfig({
        deviceId: 60,
    });
    export const renderedConfig = serverConfig.then(serverConfig => serverConfig.content);
    export const templateUsed = serverConfig.then(serverConfig => serverConfig.configTemplateName);
    
    import pulumi
    import pulumi_netbox as netbox
    
    # Get the rendered configuration for a device
    server_config = netbox.get_device_render_config(device_id=60)
    pulumi.export("renderedConfig", server_config.content)
    pulumi.export("templateUsed", server_config.config_template_name)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/netbox/v5/netbox"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		// Get the rendered configuration for a device
    		serverConfig, err := netbox.GetDeviceRenderConfig(ctx, &netbox.GetDeviceRenderConfigArgs{
    			DeviceId: 60,
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("renderedConfig", serverConfig.Content)
    		ctx.Export("templateUsed", serverConfig.ConfigTemplateName)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Netbox = Pulumi.Netbox;
    
    return await Deployment.RunAsync(() => 
    {
        // Get the rendered configuration for a device
        var serverConfig = Netbox.GetDeviceRenderConfig.Invoke(new()
        {
            DeviceId = 60,
        });
    
        return new Dictionary<string, object?>
        {
            ["renderedConfig"] = serverConfig.Apply(getDeviceRenderConfigResult => getDeviceRenderConfigResult.Content),
            ["templateUsed"] = serverConfig.Apply(getDeviceRenderConfigResult => getDeviceRenderConfigResult.ConfigTemplateName),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    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) {
            // Get the rendered configuration for a device
            final var serverConfig = NetboxFunctions.getDeviceRenderConfig(GetDeviceRenderConfigArgs.builder()
                .deviceId(60)
                .build());
    
            ctx.export("renderedConfig", serverConfig.content());
            ctx.export("templateUsed", serverConfig.configTemplateName());
        }
    }
    
    variables:
      # Get the rendered configuration for a device
      serverConfig:
        fn::invoke:
          function: netbox:getDeviceRenderConfig
          arguments:
            deviceId: 60
    outputs:
      # Use the rendered configuration
      renderedConfig: ${serverConfig.content}
      templateUsed: ${serverConfig.configTemplateName}
    

    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?: InvokeOptions): Output<GetDeviceRenderConfigResult>
    def get_device_render_config(device_id: Optional[float] = None,
                                 id: Optional[str] = None,
                                 opts: Optional[InvokeOptions] = None) -> GetDeviceRenderConfigResult
    def get_device_render_config_output(device_id: Optional[pulumi.Input[float]] = None,
                                 id: Optional[pulumi.Input[str]] = None,
                                 opts: Optional[InvokeOptions] = 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 CompletableFuture<GetDeviceRenderConfigResult> getDeviceRenderConfig(GetDeviceRenderConfigArgs args, InvokeOptions options)
    public static Output<GetDeviceRenderConfigResult> getDeviceRenderConfig(GetDeviceRenderConfigArgs args, InvokeOptions options)
    
    fn::invoke:
      function: netbox:index/getDeviceRenderConfig:getDeviceRenderConfig
      arguments:
        # arguments dictionary

    The following arguments are supported:

    DeviceId double
    The ID of the device to render configuration for.
    Id string
    The ID of this resource.
    DeviceId float64
    The ID of the device to render configuration for.
    Id string
    The ID of this resource.
    deviceId Double
    The ID of the device to render configuration for.
    id String
    The ID of this resource.
    deviceId number
    The ID of the device to render configuration for.
    id string
    The ID of this resource.
    device_id float
    The ID of the device to render configuration for.
    id str
    The ID of this resource.
    deviceId Number
    The ID of the device to render configuration for.
    id String
    The ID of this resource.

    getDeviceRenderConfig Result

    The following output properties are available:

    ConfigTemplateId double
    The ID of the config template that was used for rendering.
    ConfigTemplateName string
    The name of the config template that was used for rendering.
    Content string
    The rendered configuration content.
    DeviceId double
    The ID of the device to render configuration for.
    Id string
    The ID of this resource.
    ConfigTemplateId float64
    The ID of the config template that was used for rendering.
    ConfigTemplateName string
    The name of the config template that was used for rendering.
    Content string
    The rendered configuration content.
    DeviceId float64
    The ID of the device to render configuration for.
    Id string
    The ID of this resource.
    configTemplateId Double
    The ID of the config template that was used for rendering.
    configTemplateName String
    The name of the config template that was used for rendering.
    content String
    The rendered configuration content.
    deviceId Double
    The ID of the device to render configuration for.
    id String
    The ID of this resource.
    configTemplateId number
    The ID of the config template that was used for rendering.
    configTemplateName string
    The name of the config template that was used for rendering.
    content string
    The rendered configuration content.
    deviceId number
    The ID of the device to render configuration for.
    id string
    The ID of this resource.
    config_template_id float
    The ID of the config template that was used for rendering.
    config_template_name str
    The name of the config template that was used for rendering.
    content str
    The rendered configuration content.
    device_id float
    The ID of the device to render configuration for.
    id str
    The ID of this resource.
    configTemplateId Number
    The ID of the config template that was used for rendering.
    configTemplateName String
    The name of the config template that was used for rendering.
    content String
    The rendered configuration content.
    deviceId Number
    The ID of the device to render configuration for.
    id String
    The ID of this resource.

    Package Details

    Repository
    netbox e-breuninger/terraform-provider-netbox
    License
    Notes
    This Pulumi package is based on the netbox Terraform Provider.
    netbox logo
    netbox 5.1.0 published on Monday, Jan 26, 2026 by e-breuninger
      Meet Neo: Your AI Platform Teammate