published on Monday, Nov 16, 2026 by e-breuninger
published on Monday, Nov 16, 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:
- Local
Vid double - VLAN id on the local side (1-4094). Must be a whole number.
- Remote
Vid double - VLAN id on the remote side (1-4094). Must be a whole number.
- Vlan
Translation doublePolicy Id - Id of the translation policy the rule belongs to.
- Description string
- Local
Vid float64 - VLAN id on the local side (1-4094). Must be a whole number.
- Remote
Vid float64 - VLAN id on the remote side (1-4094). Must be a whole number.
- Vlan
Translation float64Policy Id - 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_ numberpolicy_ id - Id of the translation policy the rule belongs to.
- description string
- local
Vid Double - VLAN id on the local side (1-4094). Must be a whole number.
- remote
Vid Double - VLAN id on the remote side (1-4094). Must be a whole number.
- vlan
Translation DoublePolicy Id - 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 numberPolicy Id - 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_ floatpolicy_ id - Id of the translation policy the rule belongs to.
- description str
- 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 NumberPolicy Id - 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
- Vlan
Translation doubleRule Id - NetBox id.
- Id string
- The provider-assigned unique ID for this managed resource.
- Url string
- Vlan
Translation float64Rule Id - NetBox id.
- id string
- The provider-assigned unique ID for this managed resource.
- url string
- vlan_
translation_ numberrule_ id - NetBox id.
- id String
- The provider-assigned unique ID for this managed resource.
- url String
- vlan
Translation DoubleRule Id - NetBox id.
- id string
- The provider-assigned unique ID for this managed resource.
- url string
- vlan
Translation numberRule Id - NetBox id.
- id str
- The provider-assigned unique ID for this managed resource.
- url str
- vlan_
translation_ floatrule_ id - NetBox id.
- id String
- The provider-assigned unique ID for this managed resource.
- url String
- vlan
Translation NumberRule Id - 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) -> VlanTranslationRulefunc 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: existingVlanTranslationRule: type: netbox:VlanTranslationRule get: id: ${id}import {
to = netbox_vlan_translation_rule.example
id = "${id}"
}
- name string
- The unique name of the resulting resource.
- id Input<ID>
- The unique provider ID of the resource to look up.
- state VlanTranslationRuleState
- Known property values the provider needs, along with the ID, to find the resource. Usually not required.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resulting resource.
- id str
- The unique provider ID of the resource to look up.
- 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 resulting resource.
- id IDInput
- The unique provider ID of the resource to look up.
- state VlanTranslationRuleState
- Known property values the provider needs, along with the ID, to find the resource. Usually not required.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resulting resource.
- id Input<string>
- The unique provider ID of the resource to look up.
- state VlanTranslationRuleState
- Known property values the provider needs, along with the ID, to find the resource. Usually not required.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resulting resource.
- id Output<String>
- The unique provider ID of the resource to look up.
- state VlanTranslationRuleState
- Known property values the provider needs, along with the ID, to find the resource. Usually not required.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
- Description string
- Local
Vid double - VLAN id on the local side (1-4094). Must be a whole number.
- Remote
Vid double - VLAN id on the remote side (1-4094). Must be a whole number.
- Url string
- Vlan
Translation doublePolicy Id - Id of the translation policy the rule belongs to.
- Vlan
Translation doubleRule Id - NetBox id.
- Description string
- Local
Vid float64 - VLAN id on the local side (1-4094). Must be a whole number.
- Remote
Vid float64 - VLAN id on the remote side (1-4094). Must be a whole number.
- Url string
- Vlan
Translation float64Policy Id - Id of the translation policy the rule belongs to.
- Vlan
Translation float64Rule Id - 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_ numberpolicy_ id - Id of the translation policy the rule belongs to.
- vlan_
translation_ numberrule_ id - NetBox id.
- description String
- local
Vid Double - VLAN id on the local side (1-4094). Must be a whole number.
- remote
Vid Double - VLAN id on the remote side (1-4094). Must be a whole number.
- url String
- vlan
Translation DoublePolicy Id - Id of the translation policy the rule belongs to.
- vlan
Translation DoubleRule Id - 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 numberPolicy Id - Id of the translation policy the rule belongs to.
- vlan
Translation numberRule Id - 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_ floatpolicy_ id - Id of the translation policy the rule belongs to.
- vlan_
translation_ floatrule_ id - 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 NumberPolicy Id - Id of the translation policy the rule belongs to.
- vlan
Translation NumberRule Id - 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
netboxTerraform Provider.
published on Monday, Nov 16, 2026 by e-breuninger