netbox.VpnTunnelTermination
Explore with Pulumi AI
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", {description: "description"});
const testVpnTunnel = new netbox.VpnTunnel("testVpnTunnel", {
encapsulation: "ipsec-transport",
status: "active",
tunnelGroupId: testVpnTunnelGroup.vpnTunnelGroupId,
});
const device = new netbox.VpnTunnelTermination("device", {
role: "peer",
tunnelId: testVpnTunnel.vpnTunnelId,
deviceInterfaceId: 123,
});
const vm = new netbox.VpnTunnelTermination("vm", {
role: "peer",
tunnelId: testVpnTunnel.vpnTunnelId,
virtualMachineInterfaceId: 234,
});
import pulumi
import pulumi_netbox as netbox
test_vpn_tunnel_group = netbox.VpnTunnelGroup("testVpnTunnelGroup", description="description")
test_vpn_tunnel = netbox.VpnTunnel("testVpnTunnel",
encapsulation="ipsec-transport",
status="active",
tunnel_group_id=test_vpn_tunnel_group.vpn_tunnel_group_id)
device = netbox.VpnTunnelTermination("device",
role="peer",
tunnel_id=test_vpn_tunnel.vpn_tunnel_id,
device_interface_id=123)
vm = netbox.VpnTunnelTermination("vm",
role="peer",
tunnel_id=test_vpn_tunnel.vpn_tunnel_id,
virtual_machine_interface_id=234)
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", &netbox.VpnTunnelGroupArgs{
Description: pulumi.String("description"),
})
if err != nil {
return err
}
testVpnTunnel, err := netbox.NewVpnTunnel(ctx, "testVpnTunnel", &netbox.VpnTunnelArgs{
Encapsulation: pulumi.String("ipsec-transport"),
Status: pulumi.String("active"),
TunnelGroupId: testVpnTunnelGroup.VpnTunnelGroupId,
})
if err != nil {
return err
}
_, err = netbox.NewVpnTunnelTermination(ctx, "device", &netbox.VpnTunnelTerminationArgs{
Role: pulumi.String("peer"),
TunnelId: testVpnTunnel.VpnTunnelId,
DeviceInterfaceId: pulumi.Float64(123),
})
if err != nil {
return err
}
_, err = netbox.NewVpnTunnelTermination(ctx, "vm", &netbox.VpnTunnelTerminationArgs{
Role: pulumi.String("peer"),
TunnelId: testVpnTunnel.VpnTunnelId,
VirtualMachineInterfaceId: pulumi.Float64(234),
})
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", new()
{
Description = "description",
});
var testVpnTunnel = new Netbox.VpnTunnel("testVpnTunnel", new()
{
Encapsulation = "ipsec-transport",
Status = "active",
TunnelGroupId = testVpnTunnelGroup.VpnTunnelGroupId,
});
var device = new Netbox.VpnTunnelTermination("device", new()
{
Role = "peer",
TunnelId = testVpnTunnel.VpnTunnelId,
DeviceInterfaceId = 123,
});
var vm = new Netbox.VpnTunnelTermination("vm", new()
{
Role = "peer",
TunnelId = testVpnTunnel.VpnTunnelId,
VirtualMachineInterfaceId = 234,
});
});
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.VpnTunnelGroupArgs;
import com.pulumi.netbox.VpnTunnel;
import com.pulumi.netbox.VpnTunnelArgs;
import com.pulumi.netbox.VpnTunnelTermination;
import com.pulumi.netbox.VpnTunnelTerminationArgs;
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", VpnTunnelGroupArgs.builder()
.description("description")
.build());
var testVpnTunnel = new VpnTunnel("testVpnTunnel", VpnTunnelArgs.builder()
.encapsulation("ipsec-transport")
.status("active")
.tunnelGroupId(testVpnTunnelGroup.vpnTunnelGroupId())
.build());
var device = new VpnTunnelTermination("device", VpnTunnelTerminationArgs.builder()
.role("peer")
.tunnelId(testVpnTunnel.vpnTunnelId())
.deviceInterfaceId(123)
.build());
var vm = new VpnTunnelTermination("vm", VpnTunnelTerminationArgs.builder()
.role("peer")
.tunnelId(testVpnTunnel.vpnTunnelId())
.virtualMachineInterfaceId(234)
.build());
}
}
resources:
testVpnTunnelGroup:
type: netbox:VpnTunnelGroup
properties:
description: description
testVpnTunnel:
type: netbox:VpnTunnel
properties:
encapsulation: ipsec-transport
status: active
tunnelGroupId: ${testVpnTunnelGroup.vpnTunnelGroupId}
device:
type: netbox:VpnTunnelTermination
properties:
role: peer
tunnelId: ${testVpnTunnel.vpnTunnelId}
deviceInterfaceId: 123
vm:
type: netbox:VpnTunnelTermination
properties:
role: peer
tunnelId: ${testVpnTunnel.vpnTunnelId}
virtualMachineInterfaceId: 234
Create VpnTunnelTermination Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new VpnTunnelTermination(name: string, args: VpnTunnelTerminationArgs, opts?: CustomResourceOptions);
@overload
def VpnTunnelTermination(resource_name: str,
args: VpnTunnelTerminationArgs,
opts: Optional[ResourceOptions] = None)
@overload
def VpnTunnelTermination(resource_name: str,
opts: Optional[ResourceOptions] = None,
role: Optional[str] = None,
tunnel_id: Optional[float] = None,
device_interface_id: Optional[float] = None,
outside_ip_address_id: Optional[float] = None,
tags: Optional[Sequence[str]] = None,
virtual_machine_interface_id: Optional[float] = None,
vpn_tunnel_termination_id: Optional[str] = None)
func NewVpnTunnelTermination(ctx *Context, name string, args VpnTunnelTerminationArgs, opts ...ResourceOption) (*VpnTunnelTermination, error)
public VpnTunnelTermination(string name, VpnTunnelTerminationArgs args, CustomResourceOptions? opts = null)
public VpnTunnelTermination(String name, VpnTunnelTerminationArgs args)
public VpnTunnelTermination(String name, VpnTunnelTerminationArgs args, CustomResourceOptions options)
type: netbox:VpnTunnelTermination
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 VpnTunnelTerminationArgs
- 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 VpnTunnelTerminationArgs
- 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 VpnTunnelTerminationArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args VpnTunnelTerminationArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args VpnTunnelTerminationArgs
- 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 vpnTunnelTerminationResource = new Netbox.VpnTunnelTermination("vpnTunnelTerminationResource", new()
{
Role = "string",
TunnelId = 0,
DeviceInterfaceId = 0,
OutsideIpAddressId = 0,
Tags = new[]
{
"string",
},
VirtualMachineInterfaceId = 0,
VpnTunnelTerminationId = "string",
});
example, err := netbox.NewVpnTunnelTermination(ctx, "vpnTunnelTerminationResource", &netbox.VpnTunnelTerminationArgs{
Role: pulumi.String("string"),
TunnelId: pulumi.Float64(0),
DeviceInterfaceId: pulumi.Float64(0),
OutsideIpAddressId: pulumi.Float64(0),
Tags: pulumi.StringArray{
pulumi.String("string"),
},
VirtualMachineInterfaceId: pulumi.Float64(0),
VpnTunnelTerminationId: pulumi.String("string"),
})
var vpnTunnelTerminationResource = new VpnTunnelTermination("vpnTunnelTerminationResource", VpnTunnelTerminationArgs.builder()
.role("string")
.tunnelId(0)
.deviceInterfaceId(0)
.outsideIpAddressId(0)
.tags("string")
.virtualMachineInterfaceId(0)
.vpnTunnelTerminationId("string")
.build());
vpn_tunnel_termination_resource = netbox.VpnTunnelTermination("vpnTunnelTerminationResource",
role="string",
tunnel_id=0,
device_interface_id=0,
outside_ip_address_id=0,
tags=["string"],
virtual_machine_interface_id=0,
vpn_tunnel_termination_id="string")
const vpnTunnelTerminationResource = new netbox.VpnTunnelTermination("vpnTunnelTerminationResource", {
role: "string",
tunnelId: 0,
deviceInterfaceId: 0,
outsideIpAddressId: 0,
tags: ["string"],
virtualMachineInterfaceId: 0,
vpnTunnelTerminationId: "string",
});
type: netbox:VpnTunnelTermination
properties:
deviceInterfaceId: 0
outsideIpAddressId: 0
role: string
tags:
- string
tunnelId: 0
virtualMachineInterfaceId: 0
vpnTunnelTerminationId: string
VpnTunnelTermination 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 VpnTunnelTermination resource accepts the following input properties:
- Role string
- Valid values are
peer
,hub
andspoke
. - Tunnel
Id double - Device
Interface doubleId - Exactly one of
virtual_machine_interface_id
ordevice_interface_id
must be given. - Outside
Ip doubleAddress Id - List<string>
- Virtual
Machine doubleInterface Id - Exactly one of
virtual_machine_interface_id
ordevice_interface_id
must be given. - Vpn
Tunnel stringTermination Id - The ID of this resource.
- Role string
- Valid values are
peer
,hub
andspoke
. - Tunnel
Id float64 - Device
Interface float64Id - Exactly one of
virtual_machine_interface_id
ordevice_interface_id
must be given. - Outside
Ip float64Address Id - []string
- Virtual
Machine float64Interface Id - Exactly one of
virtual_machine_interface_id
ordevice_interface_id
must be given. - Vpn
Tunnel stringTermination Id - The ID of this resource.
- role String
- Valid values are
peer
,hub
andspoke
. - tunnel
Id Double - device
Interface DoubleId - Exactly one of
virtual_machine_interface_id
ordevice_interface_id
must be given. - outside
Ip DoubleAddress Id - List<String>
- virtual
Machine DoubleInterface Id - Exactly one of
virtual_machine_interface_id
ordevice_interface_id
must be given. - vpn
Tunnel StringTermination Id - The ID of this resource.
- role string
- Valid values are
peer
,hub
andspoke
. - tunnel
Id number - device
Interface numberId - Exactly one of
virtual_machine_interface_id
ordevice_interface_id
must be given. - outside
Ip numberAddress Id - string[]
- virtual
Machine numberInterface Id - Exactly one of
virtual_machine_interface_id
ordevice_interface_id
must be given. - vpn
Tunnel stringTermination Id - The ID of this resource.
- role str
- Valid values are
peer
,hub
andspoke
. - tunnel_
id float - device_
interface_ floatid - Exactly one of
virtual_machine_interface_id
ordevice_interface_id
must be given. - outside_
ip_ floataddress_ id - Sequence[str]
- virtual_
machine_ floatinterface_ id - Exactly one of
virtual_machine_interface_id
ordevice_interface_id
must be given. - vpn_
tunnel_ strtermination_ id - The ID of this resource.
- role String
- Valid values are
peer
,hub
andspoke
. - tunnel
Id Number - device
Interface NumberId - Exactly one of
virtual_machine_interface_id
ordevice_interface_id
must be given. - outside
Ip NumberAddress Id - List<String>
- virtual
Machine NumberInterface Id - Exactly one of
virtual_machine_interface_id
ordevice_interface_id
must be given. - vpn
Tunnel StringTermination Id - The ID of this resource.
Outputs
All input properties are implicitly available as output properties. Additionally, the VpnTunnelTermination 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 VpnTunnelTermination Resource
Get an existing VpnTunnelTermination 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?: VpnTunnelTerminationState, opts?: CustomResourceOptions): VpnTunnelTermination
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
device_interface_id: Optional[float] = None,
outside_ip_address_id: Optional[float] = None,
role: Optional[str] = None,
tags: Optional[Sequence[str]] = None,
tunnel_id: Optional[float] = None,
virtual_machine_interface_id: Optional[float] = None,
vpn_tunnel_termination_id: Optional[str] = None) -> VpnTunnelTermination
func GetVpnTunnelTermination(ctx *Context, name string, id IDInput, state *VpnTunnelTerminationState, opts ...ResourceOption) (*VpnTunnelTermination, error)
public static VpnTunnelTermination Get(string name, Input<string> id, VpnTunnelTerminationState? state, CustomResourceOptions? opts = null)
public static VpnTunnelTermination get(String name, Output<String> id, VpnTunnelTerminationState state, CustomResourceOptions options)
resources: _: type: netbox:VpnTunnelTermination 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.
- Device
Interface doubleId - Exactly one of
virtual_machine_interface_id
ordevice_interface_id
must be given. - Outside
Ip doubleAddress Id - Role string
- Valid values are
peer
,hub
andspoke
. - List<string>
- Tunnel
Id double - Virtual
Machine doubleInterface Id - Exactly one of
virtual_machine_interface_id
ordevice_interface_id
must be given. - Vpn
Tunnel stringTermination Id - The ID of this resource.
- Device
Interface float64Id - Exactly one of
virtual_machine_interface_id
ordevice_interface_id
must be given. - Outside
Ip float64Address Id - Role string
- Valid values are
peer
,hub
andspoke
. - []string
- Tunnel
Id float64 - Virtual
Machine float64Interface Id - Exactly one of
virtual_machine_interface_id
ordevice_interface_id
must be given. - Vpn
Tunnel stringTermination Id - The ID of this resource.
- device
Interface DoubleId - Exactly one of
virtual_machine_interface_id
ordevice_interface_id
must be given. - outside
Ip DoubleAddress Id - role String
- Valid values are
peer
,hub
andspoke
. - List<String>
- tunnel
Id Double - virtual
Machine DoubleInterface Id - Exactly one of
virtual_machine_interface_id
ordevice_interface_id
must be given. - vpn
Tunnel StringTermination Id - The ID of this resource.
- device
Interface numberId - Exactly one of
virtual_machine_interface_id
ordevice_interface_id
must be given. - outside
Ip numberAddress Id - role string
- Valid values are
peer
,hub
andspoke
. - string[]
- tunnel
Id number - virtual
Machine numberInterface Id - Exactly one of
virtual_machine_interface_id
ordevice_interface_id
must be given. - vpn
Tunnel stringTermination Id - The ID of this resource.
- device_
interface_ floatid - Exactly one of
virtual_machine_interface_id
ordevice_interface_id
must be given. - outside_
ip_ floataddress_ id - role str
- Valid values are
peer
,hub
andspoke
. - Sequence[str]
- tunnel_
id float - virtual_
machine_ floatinterface_ id - Exactly one of
virtual_machine_interface_id
ordevice_interface_id
must be given. - vpn_
tunnel_ strtermination_ id - The ID of this resource.
- device
Interface NumberId - Exactly one of
virtual_machine_interface_id
ordevice_interface_id
must be given. - outside
Ip NumberAddress Id - role String
- Valid values are
peer
,hub
andspoke
. - List<String>
- tunnel
Id Number - virtual
Machine NumberInterface Id - Exactly one of
virtual_machine_interface_id
ordevice_interface_id
must be given. - vpn
Tunnel StringTermination Id - 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.