UNPKG

@upcloud/pulumi-upcloud

Version:

A Pulumi package for creating and managing UpCloud resources.

124 lines 5.57 kB
"use strict"; // *** 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.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, Object.assign(Object.assign({}, 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 ? state.backends : undefined; resourceInputs["configuredStatus"] = state ? state.configuredStatus : undefined; resourceInputs["dnsName"] = state ? state.dnsName : undefined; resourceInputs["frontends"] = state ? state.frontends : undefined; resourceInputs["labels"] = state ? state.labels : undefined; resourceInputs["maintenanceDow"] = state ? state.maintenanceDow : undefined; resourceInputs["maintenanceTime"] = state ? state.maintenanceTime : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["network"] = state ? state.network : undefined; resourceInputs["networks"] = state ? state.networks : undefined; resourceInputs["nodes"] = state ? state.nodes : undefined; resourceInputs["operationalState"] = state ? state.operationalState : undefined; resourceInputs["plan"] = state ? state.plan : undefined; resourceInputs["resolvers"] = state ? state.resolvers : undefined; resourceInputs["zone"] = state ? state.zone : undefined; } else { const args = argsOrState; if ((!args || args.plan === undefined) && !opts.urn) { throw new Error("Missing required property 'plan'"); } if ((!args || args.zone === undefined) && !opts.urn) { throw new Error("Missing required property 'zone'"); } resourceInputs["configuredStatus"] = args ? args.configuredStatus : undefined; resourceInputs["labels"] = args ? args.labels : undefined; resourceInputs["maintenanceDow"] = args ? args.maintenanceDow : undefined; resourceInputs["maintenanceTime"] = args ? args.maintenanceTime : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["network"] = args ? args.network : undefined; resourceInputs["networks"] = args ? args.networks : undefined; resourceInputs["plan"] = args ? args.plan : undefined; resourceInputs["zone"] = args ? args.zone : undefined; 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