1. Packages
  2. Netbox Provider
  3. API Docs
  4. VpnTunnel
netbox 3.10.0 published on Monday, Apr 14, 2025 by e-breuninger

netbox.VpnTunnel

Explore with Pulumi AI

netbox logo
netbox 3.10.0 published on Monday, Apr 14, 2025 by e-breuninger

    From the official documentation:

    NetBox can model private tunnels formed among virtual termination points across your network. Typical tunnel implementations include GRE, IP-in-IP, and IPSec. A tunnel may be terminated to two or more device or virtual machine interfaces. For convenient organization, tunnels may be assigned to user-defined groups.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as netbox from "@pulumi/netbox";
    
    const testVpnTunnelGroup = new netbox.VpnTunnelGroup("testVpnTunnelGroup", {});
    const testVpnTunnel = new netbox.VpnTunnel("testVpnTunnel", {
        encapsulation: "ipsec-transport",
        status: "active",
        tunnelGroupId: testVpnTunnelGroup.vpnTunnelGroupId,
        description: "This is a description.",
        tunnelId: 3,
        tenantId: 2,
    });
    
    import pulumi
    import pulumi_netbox as netbox
    
    test_vpn_tunnel_group = netbox.VpnTunnelGroup("testVpnTunnelGroup")
    test_vpn_tunnel = netbox.VpnTunnel("testVpnTunnel",
        encapsulation="ipsec-transport",
        status="active",
        tunnel_group_id=test_vpn_tunnel_group.vpn_tunnel_group_id,
        description="This is a description.",
        tunnel_id=3,
        tenant_id=2)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/netbox/v3/netbox"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		testVpnTunnelGroup, err := netbox.NewVpnTunnelGroup(ctx, "testVpnTunnelGroup", nil)
    		if err != nil {
    			return err
    		}
    		_, err = netbox.NewVpnTunnel(ctx, "testVpnTunnel", &netbox.VpnTunnelArgs{
    			Encapsulation: pulumi.String("ipsec-transport"),
    			Status:        pulumi.String("active"),
    			TunnelGroupId: testVpnTunnelGroup.VpnTunnelGroupId,
    			Description:   pulumi.String("This is a description."),
    			TunnelId:      pulumi.Float64(3),
    			TenantId:      pulumi.Float64(2),
    		})
    		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 testVpnTunnelGroup = new Netbox.VpnTunnelGroup("testVpnTunnelGroup");
    
        var testVpnTunnel = new Netbox.VpnTunnel("testVpnTunnel", new()
        {
            Encapsulation = "ipsec-transport",
            Status = "active",
            TunnelGroupId = testVpnTunnelGroup.VpnTunnelGroupId,
            Description = "This is a description.",
            TunnelId = 3,
            TenantId = 2,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.netbox.VpnTunnelGroup;
    import com.pulumi.netbox.VpnTunnel;
    import com.pulumi.netbox.VpnTunnelArgs;
    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 testVpnTunnelGroup = new VpnTunnelGroup("testVpnTunnelGroup");
    
            var testVpnTunnel = new VpnTunnel("testVpnTunnel", VpnTunnelArgs.builder()
                .encapsulation("ipsec-transport")
                .status("active")
                .tunnelGroupId(testVpnTunnelGroup.vpnTunnelGroupId())
                .description("This is a description.")
                .tunnelId(3)
                .tenantId(2)
                .build());
    
        }
    }
    
    resources:
      testVpnTunnelGroup:
        type: netbox:VpnTunnelGroup
      testVpnTunnel:
        type: netbox:VpnTunnel
        properties:
          encapsulation: ipsec-transport
          status: active
          tunnelGroupId: ${testVpnTunnelGroup.vpnTunnelGroupId}
          description: This is a description.
          tunnelId: 3
          tenantId: 2
    

    Create VpnTunnel Resource

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

    Constructor syntax

    new VpnTunnel(name: string, args: VpnTunnelArgs, opts?: CustomResourceOptions);
    @overload
    def VpnTunnel(resource_name: str,
                  args: VpnTunnelArgs,
                  opts: Optional[ResourceOptions] = None)
    
    @overload
    def VpnTunnel(resource_name: str,
                  opts: Optional[ResourceOptions] = None,
                  encapsulation: Optional[str] = None,
                  status: Optional[str] = None,
                  tunnel_group_id: Optional[float] = None,
                  description: Optional[str] = None,
                  name: Optional[str] = None,
                  tags: Optional[Sequence[str]] = None,
                  tenant_id: Optional[float] = None,
                  tunnel_id: Optional[float] = None,
                  vpn_tunnel_id: Optional[str] = None)
    func NewVpnTunnel(ctx *Context, name string, args VpnTunnelArgs, opts ...ResourceOption) (*VpnTunnel, error)
    public VpnTunnel(string name, VpnTunnelArgs args, CustomResourceOptions? opts = null)
    public VpnTunnel(String name, VpnTunnelArgs args)
    public VpnTunnel(String name, VpnTunnelArgs args, CustomResourceOptions options)
    
    type: netbox:VpnTunnel
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args VpnTunnelArgs
    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 VpnTunnelArgs
    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 VpnTunnelArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args VpnTunnelArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args VpnTunnelArgs
    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 vpnTunnelResource = new Netbox.VpnTunnel("vpnTunnelResource", new()
    {
        Encapsulation = "string",
        Status = "string",
        TunnelGroupId = 0,
        Description = "string",
        Name = "string",
        Tags = new[]
        {
            "string",
        },
        TenantId = 0,
        TunnelId = 0,
        VpnTunnelId = "string",
    });
    
    example, err := netbox.NewVpnTunnel(ctx, "vpnTunnelResource", &netbox.VpnTunnelArgs{
    	Encapsulation: pulumi.String("string"),
    	Status:        pulumi.String("string"),
    	TunnelGroupId: pulumi.Float64(0),
    	Description:   pulumi.String("string"),
    	Name:          pulumi.String("string"),
    	Tags: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	TenantId:    pulumi.Float64(0),
    	TunnelId:    pulumi.Float64(0),
    	VpnTunnelId: pulumi.String("string"),
    })
    
    var vpnTunnelResource = new VpnTunnel("vpnTunnelResource", VpnTunnelArgs.builder()
        .encapsulation("string")
        .status("string")
        .tunnelGroupId(0)
        .description("string")
        .name("string")
        .tags("string")
        .tenantId(0)
        .tunnelId(0)
        .vpnTunnelId("string")
        .build());
    
    vpn_tunnel_resource = netbox.VpnTunnel("vpnTunnelResource",
        encapsulation="string",
        status="string",
        tunnel_group_id=0,
        description="string",
        name="string",
        tags=["string"],
        tenant_id=0,
        tunnel_id=0,
        vpn_tunnel_id="string")
    
    const vpnTunnelResource = new netbox.VpnTunnel("vpnTunnelResource", {
        encapsulation: "string",
        status: "string",
        tunnelGroupId: 0,
        description: "string",
        name: "string",
        tags: ["string"],
        tenantId: 0,
        tunnelId: 0,
        vpnTunnelId: "string",
    });
    
    type: netbox:VpnTunnel
    properties:
        description: string
        encapsulation: string
        name: string
        status: string
        tags:
            - string
        tenantId: 0
        tunnelGroupId: 0
        tunnelId: 0
        vpnTunnelId: string
    

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

    Encapsulation string
    Valid values are ipsec-transport, ipsec-tunnel, ip-ip and gre.
    Status string
    Valid values are planned, active and disabled.
    TunnelGroupId double
    Description string
    Name string
    Tags List<string>
    TenantId double
    TunnelId double
    VpnTunnelId string
    The ID of this resource.
    Encapsulation string
    Valid values are ipsec-transport, ipsec-tunnel, ip-ip and gre.
    Status string
    Valid values are planned, active and disabled.
    TunnelGroupId float64
    Description string
    Name string
    Tags []string
    TenantId float64
    TunnelId float64
    VpnTunnelId string
    The ID of this resource.
    encapsulation String
    Valid values are ipsec-transport, ipsec-tunnel, ip-ip and gre.
    status String
    Valid values are planned, active and disabled.
    tunnelGroupId Double
    description String
    name String
    tags List<String>
    tenantId Double
    tunnelId Double
    vpnTunnelId String
    The ID of this resource.
    encapsulation string
    Valid values are ipsec-transport, ipsec-tunnel, ip-ip and gre.
    status string
    Valid values are planned, active and disabled.
    tunnelGroupId number
    description string
    name string
    tags string[]
    tenantId number
    tunnelId number
    vpnTunnelId string
    The ID of this resource.
    encapsulation str
    Valid values are ipsec-transport, ipsec-tunnel, ip-ip and gre.
    status str
    Valid values are planned, active and disabled.
    tunnel_group_id float
    description str
    name str
    tags Sequence[str]
    tenant_id float
    tunnel_id float
    vpn_tunnel_id str
    The ID of this resource.
    encapsulation String
    Valid values are ipsec-transport, ipsec-tunnel, ip-ip and gre.
    status String
    Valid values are planned, active and disabled.
    tunnelGroupId Number
    description String
    name String
    tags List<String>
    tenantId Number
    tunnelId Number
    vpnTunnelId String
    The ID of this resource.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing VpnTunnel Resource

    Get an existing VpnTunnel 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?: VpnTunnelState, opts?: CustomResourceOptions): VpnTunnel
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            description: Optional[str] = None,
            encapsulation: Optional[str] = None,
            name: Optional[str] = None,
            status: Optional[str] = None,
            tags: Optional[Sequence[str]] = None,
            tenant_id: Optional[float] = None,
            tunnel_group_id: Optional[float] = None,
            tunnel_id: Optional[float] = None,
            vpn_tunnel_id: Optional[str] = None) -> VpnTunnel
    func GetVpnTunnel(ctx *Context, name string, id IDInput, state *VpnTunnelState, opts ...ResourceOption) (*VpnTunnel, error)
    public static VpnTunnel Get(string name, Input<string> id, VpnTunnelState? state, CustomResourceOptions? opts = null)
    public static VpnTunnel get(String name, Output<String> id, VpnTunnelState state, CustomResourceOptions options)
    resources:  _:    type: netbox:VpnTunnel    get:      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
    Encapsulation string
    Valid values are ipsec-transport, ipsec-tunnel, ip-ip and gre.
    Name string
    Status string
    Valid values are planned, active and disabled.
    Tags List<string>
    TenantId double
    TunnelGroupId double
    TunnelId double
    VpnTunnelId string
    The ID of this resource.
    Description string
    Encapsulation string
    Valid values are ipsec-transport, ipsec-tunnel, ip-ip and gre.
    Name string
    Status string
    Valid values are planned, active and disabled.
    Tags []string
    TenantId float64
    TunnelGroupId float64
    TunnelId float64
    VpnTunnelId string
    The ID of this resource.
    description String
    encapsulation String
    Valid values are ipsec-transport, ipsec-tunnel, ip-ip and gre.
    name String
    status String
    Valid values are planned, active and disabled.
    tags List<String>
    tenantId Double
    tunnelGroupId Double
    tunnelId Double
    vpnTunnelId String
    The ID of this resource.
    description string
    encapsulation string
    Valid values are ipsec-transport, ipsec-tunnel, ip-ip and gre.
    name string
    status string
    Valid values are planned, active and disabled.
    tags string[]
    tenantId number
    tunnelGroupId number
    tunnelId number
    vpnTunnelId string
    The ID of this resource.
    description str
    encapsulation str
    Valid values are ipsec-transport, ipsec-tunnel, ip-ip and gre.
    name str
    status str
    Valid values are planned, active and disabled.
    tags Sequence[str]
    tenant_id float
    tunnel_group_id float
    tunnel_id float
    vpn_tunnel_id str
    The ID of this resource.
    description String
    encapsulation String
    Valid values are ipsec-transport, ipsec-tunnel, ip-ip and gre.
    name String
    status String
    Valid values are planned, active and disabled.
    tags List<String>
    tenantId Number
    tunnelGroupId Number
    tunnelId Number
    vpnTunnelId 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 3.10.0 published on Monday, Apr 14, 2025 by e-breuninger