@natzka-oss/pulumi-netbox
Version:
A Pulumi package for creating and managing Netbox cloud resources.
98 lines • 4.61 kB
JavaScript
;
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.VpnTunnelTermination = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* From the [official documentation](https://docs.netbox.dev/en/stable/features/vpn-tunnels/):
*
* > 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
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as netbox from "@natzka-oss/pulumi-netbox";
*
* const test = new netbox.vpn.VpnTunnelGroup("test", {
* name: "my-tunnel-group",
* description: "description",
* });
* const testVpnTunnel = new netbox.vpn.VpnTunnel("test", {
* name: "my-tunnel",
* encapsulation: "ipsec-transport",
* status: "active",
* tunnelGroupId: test.id,
* });
* const device = new netbox.vpn.VpnTunnelTermination("device", {
* role: "peer",
* tunnelId: testVpnTunnel.id,
* deviceInterfaceId: 123,
* });
* const vm = new netbox.vpn.VpnTunnelTermination("vm", {
* role: "peer",
* tunnelId: testVpnTunnel.id,
* virtualMachineInterfaceId: 234,
* });
* ```
*/
class VpnTunnelTermination extends pulumi.CustomResource {
/**
* Get an existing VpnTunnelTermination resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name, id, state, opts) {
return new VpnTunnelTermination(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of VpnTunnelTermination. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === VpnTunnelTermination.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["deviceInterfaceId"] = state ? state.deviceInterfaceId : undefined;
resourceInputs["outsideIpAddressId"] = state ? state.outsideIpAddressId : undefined;
resourceInputs["role"] = state ? state.role : undefined;
resourceInputs["tags"] = state ? state.tags : undefined;
resourceInputs["tunnelId"] = state ? state.tunnelId : undefined;
resourceInputs["virtualMachineInterfaceId"] = state ? state.virtualMachineInterfaceId : undefined;
}
else {
const args = argsOrState;
if ((!args || args.role === undefined) && !opts.urn) {
throw new Error("Missing required property 'role'");
}
if ((!args || args.tunnelId === undefined) && !opts.urn) {
throw new Error("Missing required property 'tunnelId'");
}
resourceInputs["deviceInterfaceId"] = args ? args.deviceInterfaceId : undefined;
resourceInputs["outsideIpAddressId"] = args ? args.outsideIpAddressId : undefined;
resourceInputs["role"] = args ? args.role : undefined;
resourceInputs["tags"] = args ? args.tags : undefined;
resourceInputs["tunnelId"] = args ? args.tunnelId : undefined;
resourceInputs["virtualMachineInterfaceId"] = args ? args.virtualMachineInterfaceId : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(VpnTunnelTermination.__pulumiType, name, resourceInputs, opts);
}
}
exports.VpnTunnelTermination = VpnTunnelTermination;
/** @internal */
VpnTunnelTermination.__pulumiType = 'netbox:vpn/vpnTunnelTermination:VpnTunnelTermination';
//# sourceMappingURL=vpnTunnelTermination.js.map