@upcloud/pulumi-upcloud
Version:
A Pulumi package for creating and managing UpCloud resources.
128 lines • 5.23 kB
JavaScript
;
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.GatewayConnectionTunnel = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as upcloud from "@upcloud/pulumi-upcloud";
*
* const _this = new upcloud.Router("this", {name: "gateway-example-router"});
* const thisNetwork = new upcloud.Network("this", {
* name: "gateway-example-net",
* zone: "pl-waw1",
* ipNetwork: {
* address: "172.16.2.0/24",
* dhcp: true,
* family: "IPv4",
* },
* router: _this.id,
* });
* const thisGateway = new upcloud.Gateway("this", {
* name: "gateway-example-gw",
* zone: "pl-waw1",
* features: ["vpn"],
* plan: "advanced",
* router: {
* id: _this.id,
* },
* });
* const thisGatewayConnection = new upcloud.GatewayConnection("this", {
* gateway: thisGateway.id,
* name: "test-connection",
* type: "ipsec",
* localRoutes: [{
* name: "local-route",
* type: "static",
* staticNetwork: "10.123.123.0/24",
* }],
* remoteRoutes: [{
* name: "remote-route",
* type: "static",
* staticNetwork: "100.123.123.0/24",
* }],
* });
* const thisGatewayConnectionTunnel = new upcloud.GatewayConnectionTunnel("this", {
* connectionId: thisGatewayConnection.id,
* name: "test-tunnel",
* localAddressName: thisGateway.address[0].name,
* remoteAddress: "100.123.123.10",
* ipsecAuthPsk: {
* psk: "you_probably_want_to_use_env_vars_here",
* },
* });
* ```
*/
class GatewayConnectionTunnel extends pulumi.CustomResource {
/**
* Get an existing GatewayConnectionTunnel 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 GatewayConnectionTunnel(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of GatewayConnectionTunnel. 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'] === GatewayConnectionTunnel.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["connectionId"] = state?.connectionId;
resourceInputs["ipsecAuthPsk"] = state?.ipsecAuthPsk;
resourceInputs["ipsecProperties"] = state?.ipsecProperties;
resourceInputs["localAddressName"] = state?.localAddressName;
resourceInputs["name"] = state?.name;
resourceInputs["operationalState"] = state?.operationalState;
resourceInputs["remoteAddress"] = state?.remoteAddress;
resourceInputs["uuid"] = state?.uuid;
}
else {
const args = argsOrState;
if (args?.connectionId === undefined && !opts.urn) {
throw new Error("Missing required property 'connectionId'");
}
if (args?.ipsecAuthPsk === undefined && !opts.urn) {
throw new Error("Missing required property 'ipsecAuthPsk'");
}
if (args?.localAddressName === undefined && !opts.urn) {
throw new Error("Missing required property 'localAddressName'");
}
if (args?.remoteAddress === undefined && !opts.urn) {
throw new Error("Missing required property 'remoteAddress'");
}
resourceInputs["connectionId"] = args?.connectionId;
resourceInputs["ipsecAuthPsk"] = args?.ipsecAuthPsk;
resourceInputs["ipsecProperties"] = args?.ipsecProperties;
resourceInputs["localAddressName"] = args?.localAddressName;
resourceInputs["name"] = args?.name;
resourceInputs["remoteAddress"] = args?.remoteAddress;
resourceInputs["operationalState"] = undefined /*out*/;
resourceInputs["uuid"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(GatewayConnectionTunnel.__pulumiType, name, resourceInputs, opts);
}
}
exports.GatewayConnectionTunnel = GatewayConnectionTunnel;
/** @internal */
GatewayConnectionTunnel.__pulumiType = 'upcloud:index/gatewayConnectionTunnel:GatewayConnectionTunnel';
//# sourceMappingURL=gatewayConnectionTunnel.js.map