@natzka-oss/pulumi-netbox
Version:
A Pulumi package for creating and managing Netbox cloud resources.
95 lines • 4.57 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.VpnTunnel = 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"});
* const testVpnTunnel = new netbox.vpn.VpnTunnel("test", {
* name: "my-tunnel",
* encapsulation: "ipsec-transport",
* status: "active",
* tunnelGroupId: test.id,
* description: "This is a description.",
* tunnelId: 3,
* tenantId: 2,
* });
* ```
*/
class VpnTunnel extends pulumi.CustomResource {
/**
* Get an existing VpnTunnel 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 VpnTunnel(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of VpnTunnel. 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'] === VpnTunnel.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["encapsulation"] = state ? state.encapsulation : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["status"] = state ? state.status : undefined;
resourceInputs["tags"] = state ? state.tags : undefined;
resourceInputs["tenantId"] = state ? state.tenantId : undefined;
resourceInputs["tunnelGroupId"] = state ? state.tunnelGroupId : undefined;
resourceInputs["tunnelId"] = state ? state.tunnelId : undefined;
}
else {
const args = argsOrState;
if ((!args || args.encapsulation === undefined) && !opts.urn) {
throw new Error("Missing required property 'encapsulation'");
}
if ((!args || args.status === undefined) && !opts.urn) {
throw new Error("Missing required property 'status'");
}
if ((!args || args.tunnelGroupId === undefined) && !opts.urn) {
throw new Error("Missing required property 'tunnelGroupId'");
}
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["encapsulation"] = args ? args.encapsulation : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["status"] = args ? args.status : undefined;
resourceInputs["tags"] = args ? args.tags : undefined;
resourceInputs["tenantId"] = args ? args.tenantId : undefined;
resourceInputs["tunnelGroupId"] = args ? args.tunnelGroupId : undefined;
resourceInputs["tunnelId"] = args ? args.tunnelId : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(VpnTunnel.__pulumiType, name, resourceInputs, opts);
}
}
exports.VpnTunnel = VpnTunnel;
/** @internal */
VpnTunnel.__pulumiType = 'netbox:vpn/vpnTunnel:VpnTunnel';
//# sourceMappingURL=vpnTunnel.js.map