1. Registry
  2. Packages
  3. Netbox Provider
  4. API Docs
  5. getL2vpn
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 layer 2 VPN (vpn.l2vpn).

    From the official documentation:

    A L2VPN object is NetBox is a representation of a layer 2 bridge technology such as VXLAN, VPLS, or EPL. Each L2VPN can be identified by name as well as by an optional unique identifier (VNI would be an example). Once created, L2VPNs can be terminated to interfaces and VLANs.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as netbox from "@pulumi/netbox";
    
    const test = netbox.getL2vpn({
        name: "test-l2vpn",
    });
    
    import pulumi
    import pulumi_netbox as netbox
    
    test = netbox.get_l2vpn(name="test-l2vpn")
    
    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 {
    		_, err := netbox.LookupL2vpn(ctx, &netbox.LookupL2vpnArgs{
    			Name: pulumi.StringRef("test-l2vpn"),
    		}, nil)
    		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 = Netbox.GetL2vpn.Invoke(new()
        {
            Name = "test-l2vpn",
        });
    
    });
    
    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.GetL2vpnArgs;
    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) {
            final var test = NetboxFunctions.getL2vpn(GetL2vpnArgs.builder()
                .name("test-l2vpn")
                .build());
    
        }
    }
    
    variables:
      test:
        fn::invoke:
          function: netbox:getL2vpn
          arguments:
            name: test-l2vpn
    
    Example coming soon!
    

    Using getL2vpn

    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 getL2vpn(args: GetL2vpnArgs, opts?: InvokeOptions): Promise<GetL2vpnResult>
    function getL2vpnOutput(args: GetL2vpnOutputArgs, opts?: InvokeOutputOptions): Output<GetL2vpnResult>
    def get_l2vpn(custom_field_filters: Optional[Mapping[str, str]] = None,
                  id: Optional[float] = None,
                  identifier: Optional[float] = None,
                  name: Optional[str] = None,
                  owner_id: Optional[float] = None,
                  slug: Optional[str] = None,
                  tag_slug: Optional[str] = None,
                  type: Optional[str] = None,
                  opts: Optional[InvokeOptions] = None) -> GetL2vpnResult
    def get_l2vpn_output(custom_field_filters: pulumi.Input[Optional[Mapping[str, pulumi.Input[str]]]] = None,
                  id: pulumi.Input[Optional[float]] = None,
                  identifier: pulumi.Input[Optional[float]] = None,
                  name: pulumi.Input[Optional[str]] = None,
                  owner_id: pulumi.Input[Optional[float]] = None,
                  slug: pulumi.Input[Optional[str]] = None,
                  tag_slug: pulumi.Input[Optional[str]] = None,
                  type: pulumi.Input[Optional[str]] = None,
                  opts: Optional[InvokeOutputOptions] = None) -> Output[GetL2vpnResult]
    func LookupL2vpn(ctx *Context, args *LookupL2vpnArgs, opts ...InvokeOption) (*LookupL2vpnResult, error)
    func LookupL2vpnOutput(ctx *Context, args *LookupL2vpnOutputArgs, opts ...InvokeOption) LookupL2vpnResultOutput

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

    public static class GetL2vpn 
    {
        public static Task<GetL2vpnResult> InvokeAsync(GetL2vpnArgs args, InvokeOptions? opts = null)
        public static Output<GetL2vpnResult> Invoke(GetL2vpnInvokeArgs args, InvokeOptions? opts = null)
        public static Output<GetL2vpnResult> Invoke(GetL2vpnInvokeArgs args, InvokeOutputOptions opts)
    }
    public static CompletableFuture<GetL2vpnResult> getL2vpn(GetL2vpnArgs args, InvokeOptions options)
    public static Output<GetL2vpnResult> getL2vpn(GetL2vpnArgs args, InvokeOptions options)
    public static Output<GetL2vpnResult> getL2vpn(GetL2vpnArgs args, InvokeOutputOptions options)
    
    fn::invoke:
      function: netbox:index/getL2vpn:getL2vpn
      arguments:
        # arguments dictionary
    data "netbox_get_l2vpn" "name" {
        # arguments
    }

    The following arguments are supported:

    CustomFieldFilters Dictionary<string, string>
    Custom field values to match, by field name, e.g. { tier = "gold" }: each entry filters as cf_\n\n with the field's own filter logic, loose (case-insensitive substring) or exact.
    Id double
    NetBox id.
    Identifier double
    Numeric identifier (e.g. the VNI or VPLS id), not the NetBox id. Must be a whole number.
    Name string
    OwnerId double
    Id of the owner the object is assigned to.
    Slug string
    URL-friendly unique shorthand; derived from name when not set.
    TagSlug string
    Slug of a tag the object carries.
    Type string
    L2VPN technology. One of: vpws, vpls, vxlan, vxlan-evpn, mpls-evpn, pbb-evpn, epl, evpl, ep-lan, evp-lan, ep-tree, evp-tree, evpn-vpws, spb.
    CustomFieldFilters map[string]string
    Custom field values to match, by field name, e.g. { tier = "gold" }: each entry filters as cf_\n\n with the field's own filter logic, loose (case-insensitive substring) or exact.
    Id float64
    NetBox id.
    Identifier float64
    Numeric identifier (e.g. the VNI or VPLS id), not the NetBox id. Must be a whole number.
    Name string
    OwnerId float64
    Id of the owner the object is assigned to.
    Slug string
    URL-friendly unique shorthand; derived from name when not set.
    TagSlug string
    Slug of a tag the object carries.
    Type string
    L2VPN technology. One of: vpws, vpls, vxlan, vxlan-evpn, mpls-evpn, pbb-evpn, epl, evpl, ep-lan, evp-lan, ep-tree, evp-tree, evpn-vpws, spb.
    custom_field_filters map(string)
    Custom field values to match, by field name, e.g. { tier = "gold" }: each entry filters as cf_\n\n with the field's own filter logic, loose (case-insensitive substring) or exact.
    id number
    NetBox id.
    identifier number
    Numeric identifier (e.g. the VNI or VPLS id), not the NetBox id. Must be a whole number.
    name string
    owner_id number
    Id of the owner the object is assigned to.
    slug string
    URL-friendly unique shorthand; derived from name when not set.
    tag_slug string
    Slug of a tag the object carries.
    type string
    L2VPN technology. One of: vpws, vpls, vxlan, vxlan-evpn, mpls-evpn, pbb-evpn, epl, evpl, ep-lan, evp-lan, ep-tree, evp-tree, evpn-vpws, spb.
    customFieldFilters Map<String,String>
    Custom field values to match, by field name, e.g. { tier = "gold" }: each entry filters as cf_\n\n with the field's own filter logic, loose (case-insensitive substring) or exact.
    id Double
    NetBox id.
    identifier Double
    Numeric identifier (e.g. the VNI or VPLS id), not the NetBox id. Must be a whole number.
    name String
    ownerId Double
    Id of the owner the object is assigned to.
    slug String
    URL-friendly unique shorthand; derived from name when not set.
    tagSlug String
    Slug of a tag the object carries.
    type String
    L2VPN technology. One of: vpws, vpls, vxlan, vxlan-evpn, mpls-evpn, pbb-evpn, epl, evpl, ep-lan, evp-lan, ep-tree, evp-tree, evpn-vpws, spb.
    customFieldFilters {[key: string]: string}
    Custom field values to match, by field name, e.g. { tier = "gold" }: each entry filters as cf_\n\n with the field's own filter logic, loose (case-insensitive substring) or exact.
    id number
    NetBox id.
    identifier number
    Numeric identifier (e.g. the VNI or VPLS id), not the NetBox id. Must be a whole number.
    name string
    ownerId number
    Id of the owner the object is assigned to.
    slug string
    URL-friendly unique shorthand; derived from name when not set.
    tagSlug string
    Slug of a tag the object carries.
    type string
    L2VPN technology. One of: vpws, vpls, vxlan, vxlan-evpn, mpls-evpn, pbb-evpn, epl, evpl, ep-lan, evp-lan, ep-tree, evp-tree, evpn-vpws, spb.
    custom_field_filters Mapping[str, str]
    Custom field values to match, by field name, e.g. { tier = "gold" }: each entry filters as cf_\n\n with the field's own filter logic, loose (case-insensitive substring) or exact.
    id float
    NetBox id.
    identifier float
    Numeric identifier (e.g. the VNI or VPLS id), not the NetBox id. Must be a whole number.
    name str
    owner_id float
    Id of the owner the object is assigned to.
    slug str
    URL-friendly unique shorthand; derived from name when not set.
    tag_slug str
    Slug of a tag the object carries.
    type str
    L2VPN technology. One of: vpws, vpls, vxlan, vxlan-evpn, mpls-evpn, pbb-evpn, epl, evpl, ep-lan, evp-lan, ep-tree, evp-tree, evpn-vpws, spb.
    customFieldFilters Map<String>
    Custom field values to match, by field name, e.g. { tier = "gold" }: each entry filters as cf_\n\n with the field's own filter logic, loose (case-insensitive substring) or exact.
    id Number
    NetBox id.
    identifier Number
    Numeric identifier (e.g. the VNI or VPLS id), not the NetBox id. Must be a whole number.
    name String
    ownerId Number
    Id of the owner the object is assigned to.
    slug String
    URL-friendly unique shorthand; derived from name when not set.
    tagSlug String
    Slug of a tag the object carries.
    type String
    L2VPN technology. One of: vpws, vpls, vxlan, vxlan-evpn, mpls-evpn, pbb-evpn, epl, evpl, ep-lan, evp-lan, ep-tree, evp-tree, evpn-vpws, spb.

    getL2vpn Result

    The following output properties are available:

    Comments string
    Created string
    CustomFields Dictionary<string, string>
    Custom field values by field name. Every value is a string; NetBox coerces numbers and booleans. An object field holds the related object's id, e.g. "12", a multiobject field a JSON list of ids in any order, e.g. jsonencode([12, 13]). A key removed from the map is cleared in NetBox (set {} to clear all).
    Description string
    ExportTargetIds List<double>
    Ids of exported route targets.
    Id double
    NetBox id.
    Identifier double
    Numeric identifier (e.g. the VNI or VPLS id), not the NetBox id. Must be a whole number.
    ImportTargetIds List<double>
    Ids of imported route targets.
    LastUpdated string
    Name string
    OwnerId double
    Id of the owner the object is assigned to.
    Slug string
    URL-friendly unique shorthand; derived from name when not set.
    Status string
    Operational status. One of: active, planned, decommissioning.
    Tags List<string>
    Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
    TagsAlls List<string>
    Slugs of all tags on the object, including the provider's default_tags.
    TenantId double
    Id of the tenant.
    Type string
    L2VPN technology. One of: vpws, vpls, vxlan, vxlan-evpn, mpls-evpn, pbb-evpn, epl, evpl, ep-lan, evp-lan, ep-tree, evp-tree, evpn-vpws, spb.
    Url string
    CustomFieldFilters Dictionary<string, string>
    Custom field values to match, by field name, e.g. { tier = "gold" }: each entry filters as cf_\n\n with the field's own filter logic, loose (case-insensitive substring) or exact.
    TagSlug string
    Slug of a tag the object carries.
    Comments string
    Created string
    CustomFields map[string]string
    Custom field values by field name. Every value is a string; NetBox coerces numbers and booleans. An object field holds the related object's id, e.g. "12", a multiobject field a JSON list of ids in any order, e.g. jsonencode([12, 13]). A key removed from the map is cleared in NetBox (set {} to clear all).
    Description string
    ExportTargetIds []float64
    Ids of exported route targets.
    Id float64
    NetBox id.
    Identifier float64
    Numeric identifier (e.g. the VNI or VPLS id), not the NetBox id. Must be a whole number.
    ImportTargetIds []float64
    Ids of imported route targets.
    LastUpdated string
    Name string
    OwnerId float64
    Id of the owner the object is assigned to.
    Slug string
    URL-friendly unique shorthand; derived from name when not set.
    Status string
    Operational status. One of: active, planned, decommissioning.
    Tags []string
    Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
    TagsAlls []string
    Slugs of all tags on the object, including the provider's default_tags.
    TenantId float64
    Id of the tenant.
    Type string
    L2VPN technology. One of: vpws, vpls, vxlan, vxlan-evpn, mpls-evpn, pbb-evpn, epl, evpl, ep-lan, evp-lan, ep-tree, evp-tree, evpn-vpws, spb.
    Url string
    CustomFieldFilters map[string]string
    Custom field values to match, by field name, e.g. { tier = "gold" }: each entry filters as cf_\n\n with the field's own filter logic, loose (case-insensitive substring) or exact.
    TagSlug string
    Slug of a tag the object carries.
    comments string
    created string
    custom_fields map(string)
    Custom field values by field name. Every value is a string; NetBox coerces numbers and booleans. An object field holds the related object's id, e.g. "12", a multiobject field a JSON list of ids in any order, e.g. jsonencode([12, 13]). A key removed from the map is cleared in NetBox (set {} to clear all).
    description string
    export_target_ids list(number)
    Ids of exported route targets.
    id number
    NetBox id.
    identifier number
    Numeric identifier (e.g. the VNI or VPLS id), not the NetBox id. Must be a whole number.
    import_target_ids list(number)
    Ids of imported route targets.
    last_updated string
    name string
    owner_id number
    Id of the owner the object is assigned to.
    slug string
    URL-friendly unique shorthand; derived from name when not set.
    status string
    Operational status. One of: active, planned, decommissioning.
    tags list(string)
    Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
    tags_alls list(string)
    Slugs of all tags on the object, including the provider's default_tags.
    tenant_id number
    Id of the tenant.
    type string
    L2VPN technology. One of: vpws, vpls, vxlan, vxlan-evpn, mpls-evpn, pbb-evpn, epl, evpl, ep-lan, evp-lan, ep-tree, evp-tree, evpn-vpws, spb.
    url string
    custom_field_filters map(string)
    Custom field values to match, by field name, e.g. { tier = "gold" }: each entry filters as cf_\n\n with the field's own filter logic, loose (case-insensitive substring) or exact.
    tag_slug string
    Slug of a tag the object carries.
    comments String
    created String
    customFields Map<String,String>
    Custom field values by field name. Every value is a string; NetBox coerces numbers and booleans. An object field holds the related object's id, e.g. "12", a multiobject field a JSON list of ids in any order, e.g. jsonencode([12, 13]). A key removed from the map is cleared in NetBox (set {} to clear all).
    description String
    exportTargetIds List<Double>
    Ids of exported route targets.
    id Double
    NetBox id.
    identifier Double
    Numeric identifier (e.g. the VNI or VPLS id), not the NetBox id. Must be a whole number.
    importTargetIds List<Double>
    Ids of imported route targets.
    lastUpdated String
    name String
    ownerId Double
    Id of the owner the object is assigned to.
    slug String
    URL-friendly unique shorthand; derived from name when not set.
    status String
    Operational status. One of: active, planned, decommissioning.
    tags List<String>
    Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
    tagsAlls List<String>
    Slugs of all tags on the object, including the provider's default_tags.
    tenantId Double
    Id of the tenant.
    type String
    L2VPN technology. One of: vpws, vpls, vxlan, vxlan-evpn, mpls-evpn, pbb-evpn, epl, evpl, ep-lan, evp-lan, ep-tree, evp-tree, evpn-vpws, spb.
    url String
    customFieldFilters Map<String,String>
    Custom field values to match, by field name, e.g. { tier = "gold" }: each entry filters as cf_\n\n with the field's own filter logic, loose (case-insensitive substring) or exact.
    tagSlug String
    Slug of a tag the object carries.
    comments string
    created string
    customFields {[key: string]: string}
    Custom field values by field name. Every value is a string; NetBox coerces numbers and booleans. An object field holds the related object's id, e.g. "12", a multiobject field a JSON list of ids in any order, e.g. jsonencode([12, 13]). A key removed from the map is cleared in NetBox (set {} to clear all).
    description string
    exportTargetIds number[]
    Ids of exported route targets.
    id number
    NetBox id.
    identifier number
    Numeric identifier (e.g. the VNI or VPLS id), not the NetBox id. Must be a whole number.
    importTargetIds number[]
    Ids of imported route targets.
    lastUpdated string
    name string
    ownerId number
    Id of the owner the object is assigned to.
    slug string
    URL-friendly unique shorthand; derived from name when not set.
    status string
    Operational status. One of: active, planned, decommissioning.
    tags string[]
    Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
    tagsAlls string[]
    Slugs of all tags on the object, including the provider's default_tags.
    tenantId number
    Id of the tenant.
    type string
    L2VPN technology. One of: vpws, vpls, vxlan, vxlan-evpn, mpls-evpn, pbb-evpn, epl, evpl, ep-lan, evp-lan, ep-tree, evp-tree, evpn-vpws, spb.
    url string
    customFieldFilters {[key: string]: string}
    Custom field values to match, by field name, e.g. { tier = "gold" }: each entry filters as cf_\n\n with the field's own filter logic, loose (case-insensitive substring) or exact.
    tagSlug string
    Slug of a tag the object carries.
    comments str
    created str
    custom_fields Mapping[str, str]
    Custom field values by field name. Every value is a string; NetBox coerces numbers and booleans. An object field holds the related object's id, e.g. "12", a multiobject field a JSON list of ids in any order, e.g. jsonencode([12, 13]). A key removed from the map is cleared in NetBox (set {} to clear all).
    description str
    export_target_ids Sequence[float]
    Ids of exported route targets.
    id float
    NetBox id.
    identifier float
    Numeric identifier (e.g. the VNI or VPLS id), not the NetBox id. Must be a whole number.
    import_target_ids Sequence[float]
    Ids of imported route targets.
    last_updated str
    name str
    owner_id float
    Id of the owner the object is assigned to.
    slug str
    URL-friendly unique shorthand; derived from name when not set.
    status str
    Operational status. One of: active, planned, decommissioning.
    tags Sequence[str]
    Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
    tags_alls Sequence[str]
    Slugs of all tags on the object, including the provider's default_tags.
    tenant_id float
    Id of the tenant.
    type str
    L2VPN technology. One of: vpws, vpls, vxlan, vxlan-evpn, mpls-evpn, pbb-evpn, epl, evpl, ep-lan, evp-lan, ep-tree, evp-tree, evpn-vpws, spb.
    url str
    custom_field_filters Mapping[str, str]
    Custom field values to match, by field name, e.g. { tier = "gold" }: each entry filters as cf_\n\n with the field's own filter logic, loose (case-insensitive substring) or exact.
    tag_slug str
    Slug of a tag the object carries.
    comments String
    created String
    customFields Map<String>
    Custom field values by field name. Every value is a string; NetBox coerces numbers and booleans. An object field holds the related object's id, e.g. "12", a multiobject field a JSON list of ids in any order, e.g. jsonencode([12, 13]). A key removed from the map is cleared in NetBox (set {} to clear all).
    description String
    exportTargetIds List<Number>
    Ids of exported route targets.
    id Number
    NetBox id.
    identifier Number
    Numeric identifier (e.g. the VNI or VPLS id), not the NetBox id. Must be a whole number.
    importTargetIds List<Number>
    Ids of imported route targets.
    lastUpdated String
    name String
    ownerId Number
    Id of the owner the object is assigned to.
    slug String
    URL-friendly unique shorthand; derived from name when not set.
    status String
    Operational status. One of: active, planned, decommissioning.
    tags List<String>
    Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
    tagsAlls List<String>
    Slugs of all tags on the object, including the provider's default_tags.
    tenantId Number
    Id of the tenant.
    type String
    L2VPN technology. One of: vpws, vpls, vxlan, vxlan-evpn, mpls-evpn, pbb-evpn, epl, evpl, ep-lan, evp-lan, ep-tree, evp-tree, evpn-vpws, spb.
    url String
    customFieldFilters Map<String>
    Custom field values to match, by field name, e.g. { tier = "gold" }: each entry filters as cf_\n\n with the field's own filter logic, loose (case-insensitive substring) or exact.
    tagSlug String
    Slug of a tag the object carries.

    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