opnsense_interfaces_vlan (Resource)
VLANs (Virtual LANs) can be used to segment a single physical network into multiple virtual networks.
Example Usage
// OPNsense generates a device name
resource "opnsense_interfaces_vlan" "vlan" {
description = "Example vlan"
tag = 10
priority = 0
parent = "vtnet0"
}
// Manually configure a device name
resource "opnsense_interfaces_vlan" "vlan04" {
description = "Example vlan 4"
tag = 50
priority = 5
parent = "vtnet0"
device = "vlan04"
}
Schema
Required
parent(String) VLAN capable interface to attach the VLAN to, e.g.vtnet0.tag(Number) 802.1Q VLAN tag.
Optional
description(String) Optional description here for your reference (not parsed).device(String) Custom VLAN name. Custom names are possible, but only if the start of the name matches the required prefix and contains numeric characters or dots, e.g.vlan0.1.2orqinq0.3.4. Set to""to generate a device name. Defaults to""priority(Number) 802.1Q VLAN PCP (priority code point). Defaults to0.
Read-Only
id(String) UUID of the VLAN.
Import
In Terraform v1.5.0 and later, use an import block to import opnsense_interfaces_vlan using the id. For example:
import {
to = opnsense_interfaces_vlan.example
id = "<opnsense-resource-id>"
}
Using terraform import, import opnsense_interfaces_vlan using the id. For example:
% terraform import opnsense_interfaces_vlan.example <opnsense-resource-id>