1. Registry
  2. Packages
  3. Netbox Provider
  4. API Docs
  5. VlanTranslationRule
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 single VLAN id mapping inside a translation policy (ipam.vlantranslationrule).

    From the official documentation:

    A VLAN translation rule represents a one-to-one mapping of a local VLAN ID (VID) to a remote VID. Many rules can belong to a single policy.

    See VLAN translation policies for an overview of the VLAN Translation feature.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as netbox from "@pulumi/netbox";
    
    const test = new netbox.VlanTranslationPolicy("test", {name: "test-vlan-translation-policy"});
    const testVlanTranslationRule = new netbox.VlanTranslationRule("test", {
        vlanTranslationPolicyId: test.vlanTranslationPolicyId,
        localVid: 100,
        remoteVid: 200,
        description: "test-description",
    });
    
    import pulumi
    import pulumi_netbox as netbox
    
    test = netbox.VlanTranslationPolicy("test", name="test-vlan-translation-policy")
    test_vlan_translation_rule = netbox.VlanTranslationRule("test",
        vlan_translation_policy_id=test.vlan_translation_policy_id,
        local_vid=100,
        remote_vid=200,
        description="test-description")
    
    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 {
    		test, err := netbox.NewVlanTranslationPolicy(ctx, "test", &netbox.VlanTranslationPolicyArgs{
    			Name: pulumi.String("test-vlan-translation-policy"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = netbox.NewVlanTranslationRule(ctx, "test", &netbox.VlanTranslationRuleArgs{
    			VlanTranslationPolicyId: test.VlanTranslationPolicyId,
    			LocalVid:                pulumi.Float64(100),
    			RemoteVid:               pulumi.Float64(200),
    			Description:             pulumi.String("test-description"),
    		})
    		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.VlanTranslationPolicy("test", new()
        {
            Name = "test-vlan-translation-policy",
        });
    
        var testVlanTranslationRule = new Netbox.VlanTranslationRule("test", new()
        {
            VlanTranslationPolicyId = test.VlanTranslationPolicyId,
            LocalVid = 100,
            RemoteVid = 200,
            Description = "test-description",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.netbox.VlanTranslationPolicy;
    import com.pulumi.netbox.VlanTranslationPolicyArgs;
    import com.pulumi.netbox.VlanTranslationRule;
    import com.pulumi.netbox.VlanTranslationRuleArgs;
    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 VlanTranslationPolicy("test", VlanTranslationPolicyArgs.builder()
                .name("test-vlan-translation-policy")
                .build());
    
            var testVlanTranslationRule = new VlanTranslationRule("testVlanTranslationRule", VlanTranslationRuleArgs.builder()
                .vlanTranslationPolicyId(test.vlanTranslationPolicyId())
                .localVid(100.0)
                .remoteVid(200.0)
                .description("test-description")
                .build());
    
        }
    }
    
    resources:
      test:
        type: netbox:VlanTranslationPolicy
        properties:
          name: test-vlan-translation-policy
      testVlanTranslationRule:
        type: netbox:VlanTranslationRule
        name: test
        properties:
          vlanTranslationPolicyId: ${test.vlanTranslationPolicyId}
          localVid: 100
          remoteVid: 200
          description: test-description
    
    Example coming soon!
    

    Create VlanTranslationRule Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new VlanTranslationRule(name: string, args: VlanTranslationRuleArgs, opts?: CustomResourceOptions);
    @overload
    def VlanTranslationRule(resource_name: str,
                            args: VlanTranslationRuleArgs,
                            opts: Optional[ResourceOptions] = None)
    
    @overload
    def VlanTranslationRule(resource_name: str,
                            opts: Optional[ResourceOptions] = None,
                            local_vid: Optional[float] = None,
                            remote_vid: Optional[float] = None,
                            vlan_translation_policy_id: Optional[float] = None,
                            description: Optional[str] = None)
    func NewVlanTranslationRule(ctx *Context, name string, args VlanTranslationRuleArgs, opts ...ResourceOption) (*VlanTranslationRule, error)
    public VlanTranslationRule(string name, VlanTranslationRuleArgs args, CustomResourceOptions? opts = null)
    public VlanTranslationRule(String name, VlanTranslationRuleArgs args)
    public VlanTranslationRule(String name, VlanTranslationRuleArgs args, CustomResourceOptions options)
    
    type: netbox:VlanTranslationRule
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "netbox_vlan_translation_rule" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args VlanTranslationRuleArgs
    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 VlanTranslationRuleArgs
    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 VlanTranslationRuleArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args VlanTranslationRuleArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args VlanTranslationRuleArgs
    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 vlanTranslationRuleResource = new Netbox.VlanTranslationRule("vlanTranslationRuleResource", new()
    {
        LocalVid = 0.0,
        RemoteVid = 0.0,
        VlanTranslationPolicyId = 0.0,
        Description = "string",
    });
    
    example, err := netbox.NewVlanTranslationRule(ctx, "vlanTranslationRuleResource", &netbox.VlanTranslationRuleArgs{
    	LocalVid:                pulumi.Float64(0),
    	RemoteVid:               pulumi.Float64(0),
    	VlanTranslationPolicyId: pulumi.Float64(0),
    	Description:             pulumi.String("string"),
    })
    
    resource "netbox_vlan_translation_rule" "vlanTranslationRuleResource" {
      lifecycle {
        create_before_destroy = true
      }
      local_vid                  = 0
      remote_vid                 = 0
      vlan_translation_policy_id = 0
      description                = "string"
    }
    
    var vlanTranslationRuleResource = new VlanTranslationRule("vlanTranslationRuleResource", VlanTranslationRuleArgs.builder()
        .localVid(0.0)
        .remoteVid(0.0)
        .vlanTranslationPolicyId(0.0)
        .description("string")
        .build());
    
    vlan_translation_rule_resource = netbox.VlanTranslationRule("vlanTranslationRuleResource",
        local_vid=float(0),
        remote_vid=float(0),
        vlan_translation_policy_id=float(0),
        description="string")
    
    const vlanTranslationRuleResource = new netbox.VlanTranslationRule("vlanTranslationRuleResource", {
        localVid: 0,
        remoteVid: 0,
        vlanTranslationPolicyId: 0,
        description: "string",
    });
    
    type: netbox:VlanTranslationRule
    properties:
        description: string
        localVid: 0
        remoteVid: 0
        vlanTranslationPolicyId: 0
    

    VlanTranslationRule 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 VlanTranslationRule resource accepts the following input properties:

    LocalVid double
    VLAN id on the local side (1-4094). Must be a whole number.
    RemoteVid double
    VLAN id on the remote side (1-4094). Must be a whole number.
    VlanTranslationPolicyId double
    Id of the translation policy the rule belongs to.
    Description string
    LocalVid float64
    VLAN id on the local side (1-4094). Must be a whole number.
    RemoteVid float64
    VLAN id on the remote side (1-4094). Must be a whole number.
    VlanTranslationPolicyId float64
    Id of the translation policy the rule belongs to.
    Description string
    local_vid number
    VLAN id on the local side (1-4094). Must be a whole number.
    remote_vid number
    VLAN id on the remote side (1-4094). Must be a whole number.
    vlan_translation_policy_id number
    Id of the translation policy the rule belongs to.
    description string
    localVid Double
    VLAN id on the local side (1-4094). Must be a whole number.
    remoteVid Double
    VLAN id on the remote side (1-4094). Must be a whole number.
    vlanTranslationPolicyId Double
    Id of the translation policy the rule belongs to.
    description String
    localVid number
    VLAN id on the local side (1-4094). Must be a whole number.
    remoteVid number
    VLAN id on the remote side (1-4094). Must be a whole number.
    vlanTranslationPolicyId number
    Id of the translation policy the rule belongs to.
    description string
    local_vid float
    VLAN id on the local side (1-4094). Must be a whole number.
    remote_vid float
    VLAN id on the remote side (1-4094). Must be a whole number.
    vlan_translation_policy_id float
    Id of the translation policy the rule belongs to.
    description str
    localVid Number
    VLAN id on the local side (1-4094). Must be a whole number.
    remoteVid Number
    VLAN id on the remote side (1-4094). Must be a whole number.
    vlanTranslationPolicyId Number
    Id of the translation policy the rule belongs to.
    description String

    Outputs

    All input properties are implicitly available as output properties. Additionally, the VlanTranslationRule resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Url string
    VlanTranslationRuleId double
    NetBox id.
    Id string
    The provider-assigned unique ID for this managed resource.
    Url string
    VlanTranslationRuleId float64
    NetBox id.
    id string
    The provider-assigned unique ID for this managed resource.
    url string
    vlan_translation_rule_id number
    NetBox id.
    id String
    The provider-assigned unique ID for this managed resource.
    url String
    vlanTranslationRuleId Double
    NetBox id.
    id string
    The provider-assigned unique ID for this managed resource.
    url string
    vlanTranslationRuleId number
    NetBox id.
    id str
    The provider-assigned unique ID for this managed resource.
    url str
    vlan_translation_rule_id float
    NetBox id.
    id String
    The provider-assigned unique ID for this managed resource.
    url String
    vlanTranslationRuleId Number
    NetBox id.

    Look up Existing VlanTranslationRule Resource

    Get an existing VlanTranslationRule 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?: VlanTranslationRuleState, opts?: CustomResourceOptions): VlanTranslationRule
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            description: Optional[str] = None,
            local_vid: Optional[float] = None,
            remote_vid: Optional[float] = None,
            url: Optional[str] = None,
            vlan_translation_policy_id: Optional[float] = None,
            vlan_translation_rule_id: Optional[float] = None) -> VlanTranslationRule
    func GetVlanTranslationRule(ctx *Context, name string, id IDInput, state *VlanTranslationRuleState, opts ...ResourceOption) (*VlanTranslationRule, error)
    public static VlanTranslationRule Get(string name, Input<string> id, VlanTranslationRuleState? state, CustomResourceOptions? opts = null)
    public static VlanTranslationRule get(String name, Output<String> id, VlanTranslationRuleState state, CustomResourceOptions options)
    resources:  _:    type: netbox:VlanTranslationRule    get:      id: ${id}
    import {
      to = netbox_vlan_translation_rule.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:
    Description string
    LocalVid double
    VLAN id on the local side (1-4094). Must be a whole number.
    RemoteVid double
    VLAN id on the remote side (1-4094). Must be a whole number.
    Url string
    VlanTranslationPolicyId double
    Id of the translation policy the rule belongs to.
    VlanTranslationRuleId double
    NetBox id.
    Description string
    LocalVid float64
    VLAN id on the local side (1-4094). Must be a whole number.
    RemoteVid float64
    VLAN id on the remote side (1-4094). Must be a whole number.
    Url string
    VlanTranslationPolicyId float64
    Id of the translation policy the rule belongs to.
    VlanTranslationRuleId float64
    NetBox id.
    description string
    local_vid number
    VLAN id on the local side (1-4094). Must be a whole number.
    remote_vid number
    VLAN id on the remote side (1-4094). Must be a whole number.
    url string
    vlan_translation_policy_id number
    Id of the translation policy the rule belongs to.
    vlan_translation_rule_id number
    NetBox id.
    description String
    localVid Double
    VLAN id on the local side (1-4094). Must be a whole number.
    remoteVid Double
    VLAN id on the remote side (1-4094). Must be a whole number.
    url String
    vlanTranslationPolicyId Double
    Id of the translation policy the rule belongs to.
    vlanTranslationRuleId Double
    NetBox id.
    description string
    localVid number
    VLAN id on the local side (1-4094). Must be a whole number.
    remoteVid number
    VLAN id on the remote side (1-4094). Must be a whole number.
    url string
    vlanTranslationPolicyId number
    Id of the translation policy the rule belongs to.
    vlanTranslationRuleId number
    NetBox id.
    description str
    local_vid float
    VLAN id on the local side (1-4094). Must be a whole number.
    remote_vid float
    VLAN id on the remote side (1-4094). Must be a whole number.
    url str
    vlan_translation_policy_id float
    Id of the translation policy the rule belongs to.
    vlan_translation_rule_id float
    NetBox id.
    description String
    localVid Number
    VLAN id on the local side (1-4094). Must be a whole number.
    remoteVid Number
    VLAN id on the remote side (1-4094). Must be a whole number.
    url String
    vlanTranslationPolicyId Number
    Id of the translation policy the rule belongs to.
    vlanTranslationRuleId Number
    NetBox id.

    Import

    In Terraform v1.5.0 and later, the import block can be used with the id attribute, for example:

    terraform

    import {

    to = netbox_vlan_translation_rule.test

    id = “123”

    }

    The pulumi import command can be used, for example:

    $ pulumi import netbox:index/vlanTranslationRule:VlanTranslationRule 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