@upcloud/pulumi-upcloud
Version:
A Pulumi package for creating and managing UpCloud resources.
113 lines • 4.46 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.Gateway = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Network gateways connect SDN Private Networks to external IP networks.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as upcloud from "@upcloud/pulumi-upcloud";
*
* // Create router for the gateway
* const _this = new upcloud.Router("this", {name: "gateway-example-router"});
* // Create network for the gateway
* 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: ["nat"],
* router: {
* id: _this.id,
* },
* labels: {
* "managed-by": "terraform",
* },
* });
* ```
*/
class Gateway extends pulumi.CustomResource {
/**
* Get an existing Gateway 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 Gateway(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of Gateway. 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'] === Gateway.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["address"] = state?.address;
resourceInputs["addresses"] = state?.addresses;
resourceInputs["configuredStatus"] = state?.configuredStatus;
resourceInputs["connections"] = state?.connections;
resourceInputs["features"] = state?.features;
resourceInputs["labels"] = state?.labels;
resourceInputs["name"] = state?.name;
resourceInputs["operationalState"] = state?.operationalState;
resourceInputs["plan"] = state?.plan;
resourceInputs["router"] = state?.router;
resourceInputs["zone"] = state?.zone;
}
else {
const args = argsOrState;
if (args?.features === undefined && !opts.urn) {
throw new Error("Missing required property 'features'");
}
if (args?.router === undefined && !opts.urn) {
throw new Error("Missing required property 'router'");
}
if (args?.zone === undefined && !opts.urn) {
throw new Error("Missing required property 'zone'");
}
resourceInputs["address"] = args?.address;
resourceInputs["configuredStatus"] = args?.configuredStatus;
resourceInputs["features"] = args?.features;
resourceInputs["labels"] = args?.labels;
resourceInputs["name"] = args?.name;
resourceInputs["plan"] = args?.plan;
resourceInputs["router"] = args?.router;
resourceInputs["zone"] = args?.zone;
resourceInputs["addresses"] = undefined /*out*/;
resourceInputs["connections"] = undefined /*out*/;
resourceInputs["operationalState"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Gateway.__pulumiType, name, resourceInputs, opts);
}
}
exports.Gateway = Gateway;
/** @internal */
Gateway.__pulumiType = 'upcloud:index/gateway:Gateway';
//# sourceMappingURL=gateway.js.map