@upcloud/pulumi-upcloud
Version:
A Pulumi package for creating and managing UpCloud resources.
126 lines • 5.18 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.Loadbalancer = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* This resource represents [Managed Load Balancer](https://upcloud.com/products/managed-load-balancer) service.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as upcloud from "@upcloud/pulumi-upcloud";
*
* const config = new pulumi.Config();
* const lbZone = config.get("lbZone") || "fi-hel2";
* const lbNetwork = new upcloud.Network("lb_network", {
* name: "lb-test-net",
* zone: lbZone,
* ipNetwork: {
* address: "10.0.0.0/24",
* dhcp: true,
* family: "IPv4",
* },
* });
* const lb = new upcloud.Loadbalancer("lb", {
* configuredStatus: "started",
* name: "lb-test",
* plan: "development",
* zone: lbZone,
* networks: [
* {
* name: "Private-Net",
* type: "private",
* family: "IPv4",
* network: upcloudNetwork.lbNetwork.id,
* },
* {
* name: "Public-Net",
* type: "public",
* family: "IPv4",
* },
* ],
* });
* ```
*/
class Loadbalancer extends pulumi.CustomResource {
/**
* Get an existing Loadbalancer 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 Loadbalancer(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of Loadbalancer. 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'] === Loadbalancer.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["backends"] = state?.backends;
resourceInputs["configuredStatus"] = state?.configuredStatus;
resourceInputs["dnsName"] = state?.dnsName;
resourceInputs["frontends"] = state?.frontends;
resourceInputs["ipAddresses"] = state?.ipAddresses;
resourceInputs["labels"] = state?.labels;
resourceInputs["maintenanceDow"] = state?.maintenanceDow;
resourceInputs["maintenanceTime"] = state?.maintenanceTime;
resourceInputs["name"] = state?.name;
resourceInputs["network"] = state?.network;
resourceInputs["networks"] = state?.networks;
resourceInputs["nodes"] = state?.nodes;
resourceInputs["operationalState"] = state?.operationalState;
resourceInputs["plan"] = state?.plan;
resourceInputs["resolvers"] = state?.resolvers;
resourceInputs["zone"] = state?.zone;
}
else {
const args = argsOrState;
if (args?.plan === undefined && !opts.urn) {
throw new Error("Missing required property 'plan'");
}
if (args?.zone === undefined && !opts.urn) {
throw new Error("Missing required property 'zone'");
}
resourceInputs["configuredStatus"] = args?.configuredStatus;
resourceInputs["ipAddresses"] = args?.ipAddresses;
resourceInputs["labels"] = args?.labels;
resourceInputs["maintenanceDow"] = args?.maintenanceDow;
resourceInputs["maintenanceTime"] = args?.maintenanceTime;
resourceInputs["name"] = args?.name;
resourceInputs["network"] = args?.network;
resourceInputs["networks"] = args?.networks;
resourceInputs["plan"] = args?.plan;
resourceInputs["zone"] = args?.zone;
resourceInputs["backends"] = undefined /*out*/;
resourceInputs["dnsName"] = undefined /*out*/;
resourceInputs["frontends"] = undefined /*out*/;
resourceInputs["nodes"] = undefined /*out*/;
resourceInputs["operationalState"] = undefined /*out*/;
resourceInputs["resolvers"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Loadbalancer.__pulumiType, name, resourceInputs, opts);
}
}
exports.Loadbalancer = Loadbalancer;
/** @internal */
Loadbalancer.__pulumiType = 'upcloud:index/loadbalancer:Loadbalancer';
//# sourceMappingURL=loadbalancer.js.map