@pulumi/linode
Version:
A Pulumi package for creating and managing linode cloud resources.
102 lines • 4.52 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.NodeBalancer = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Provides a Linode NodeBalancer resource. This can be used to create, modify, and delete Linodes NodeBalancers in Linode's managed load balancer service.
* For more information, see [Getting Started with NodeBalancers](https://www.linode.com/docs/platform/nodebalancer/getting-started-with-nodebalancers/) and the [Linode APIv4 docs](https://techdocs.akamai.com/linode-api/reference/post-node-balancer).
*
* ## Example Usage
*
* The following example shows how one might use this resource to configure a NodeBalancer.
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as linode from "@pulumi/linode";
*
* const foobar = new linode.NodeBalancer("foobar", {
* label: "mynodebalancer",
* region: "us-east",
* clientConnThrottle: 20,
* clientUdpSessThrottle: 10,
* tags: ["foobar"],
* });
* ```
*
* ## Import
*
* Linodes NodeBalancers can be imported using the Linode NodeBalancer `id`, e.g.
*
* ```sh
* $ pulumi import linode:index/nodeBalancer:NodeBalancer mynodebalancer 1234567
* ```
*/
class NodeBalancer extends pulumi.CustomResource {
/**
* Get an existing NodeBalancer 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 NodeBalancer(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of NodeBalancer. 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'] === NodeBalancer.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["clientConnThrottle"] = state?.clientConnThrottle;
resourceInputs["clientUdpSessThrottle"] = state?.clientUdpSessThrottle;
resourceInputs["created"] = state?.created;
resourceInputs["firewallId"] = state?.firewallId;
resourceInputs["firewalls"] = state?.firewalls;
resourceInputs["hostname"] = state?.hostname;
resourceInputs["ipv4"] = state?.ipv4;
resourceInputs["ipv6"] = state?.ipv6;
resourceInputs["label"] = state?.label;
resourceInputs["region"] = state?.region;
resourceInputs["tags"] = state?.tags;
resourceInputs["transfers"] = state?.transfers;
resourceInputs["updated"] = state?.updated;
}
else {
const args = argsOrState;
resourceInputs["clientConnThrottle"] = args?.clientConnThrottle;
resourceInputs["clientUdpSessThrottle"] = args?.clientUdpSessThrottle;
resourceInputs["firewallId"] = args?.firewallId;
resourceInputs["label"] = args?.label;
resourceInputs["region"] = args?.region;
resourceInputs["tags"] = args?.tags;
resourceInputs["created"] = undefined /*out*/;
resourceInputs["firewalls"] = undefined /*out*/;
resourceInputs["hostname"] = undefined /*out*/;
resourceInputs["ipv4"] = undefined /*out*/;
resourceInputs["ipv6"] = undefined /*out*/;
resourceInputs["transfers"] = undefined /*out*/;
resourceInputs["updated"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(NodeBalancer.__pulumiType, name, resourceInputs, opts);
}
}
exports.NodeBalancer = NodeBalancer;
/** @internal */
NodeBalancer.__pulumiType = 'linode:index/nodeBalancer:NodeBalancer';
//# sourceMappingURL=nodeBalancer.js.map
;