UNPKG

@upcloud/pulumi-upcloud

Version:

A Pulumi package for creating and managing UpCloud resources.

108 lines 4.07 kB
"use strict"; // *** 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.GatewayConnection = 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", * }], * }); * ``` */ class GatewayConnection extends pulumi.CustomResource { /** * Get an existing GatewayConnection 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 GatewayConnection(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of GatewayConnection. 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'] === GatewayConnection.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["gateway"] = state?.gateway; resourceInputs["localRoutes"] = state?.localRoutes; resourceInputs["name"] = state?.name; resourceInputs["remoteRoutes"] = state?.remoteRoutes; resourceInputs["tunnels"] = state?.tunnels; resourceInputs["type"] = state?.type; resourceInputs["uuid"] = state?.uuid; } else { const args = argsOrState; if (args?.gateway === undefined && !opts.urn) { throw new Error("Missing required property 'gateway'"); } resourceInputs["gateway"] = args?.gateway; resourceInputs["localRoutes"] = args?.localRoutes; resourceInputs["name"] = args?.name; resourceInputs["remoteRoutes"] = args?.remoteRoutes; resourceInputs["type"] = args?.type; resourceInputs["tunnels"] = undefined /*out*/; resourceInputs["uuid"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(GatewayConnection.__pulumiType, name, resourceInputs, opts); } } exports.GatewayConnection = GatewayConnection; /** @internal */ GatewayConnection.__pulumiType = 'upcloud:index/gatewayConnection:GatewayConnection'; //# sourceMappingURL=gatewayConnection.js.map