UNPKG

@pulumi/linode

Version:

A Pulumi package for creating and managing linode cloud resources.

133 lines 6.42 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.NodeBalancerConfig = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * Provides a Linode NodeBalancer Config resource. This can be used to create, modify, and delete Linodes NodeBalancer Configs. * 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-config). * * ## Example Usage * * The following example shows how one might use this resource to configure a NodeBalancer Config attached to a Linode instance. * * ```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, * }); * const foofig = new linode.NodeBalancerConfig("foofig", { * nodebalancerId: foobar.id, * port: 8088, * protocol: "http", * check: "http", * checkPath: "/foo", * checkAttempts: 3, * checkTimeout: 30, * udpCheckPort: 12345, * stickiness: "http_cookie", * algorithm: "source", * }); * ``` * * ## Import * * NodeBalancer Configs can be imported using the NodeBalancer `nodebalancer_id` followed by the NodeBalancer Config `id` separated by a comma, e.g. * * ```sh * $ pulumi import linode:index/nodeBalancerConfig:NodeBalancerConfig http-foobar 1234567,7654321 * ``` */ class NodeBalancerConfig extends pulumi.CustomResource { /** * Get an existing NodeBalancerConfig 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 NodeBalancerConfig(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of NodeBalancerConfig. 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'] === NodeBalancerConfig.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["algorithm"] = state?.algorithm; resourceInputs["check"] = state?.check; resourceInputs["checkAttempts"] = state?.checkAttempts; resourceInputs["checkBody"] = state?.checkBody; resourceInputs["checkInterval"] = state?.checkInterval; resourceInputs["checkPassive"] = state?.checkPassive; resourceInputs["checkPath"] = state?.checkPath; resourceInputs["checkTimeout"] = state?.checkTimeout; resourceInputs["cipherSuite"] = state?.cipherSuite; resourceInputs["nodeStatuses"] = state?.nodeStatuses; resourceInputs["nodebalancerId"] = state?.nodebalancerId; resourceInputs["port"] = state?.port; resourceInputs["protocol"] = state?.protocol; resourceInputs["proxyProtocol"] = state?.proxyProtocol; resourceInputs["sslCert"] = state?.sslCert; resourceInputs["sslCommonname"] = state?.sslCommonname; resourceInputs["sslFingerprint"] = state?.sslFingerprint; resourceInputs["sslKey"] = state?.sslKey; resourceInputs["stickiness"] = state?.stickiness; resourceInputs["udpCheckPort"] = state?.udpCheckPort; resourceInputs["udpSessionTimeout"] = state?.udpSessionTimeout; } else { const args = argsOrState; if (args?.nodebalancerId === undefined && !opts.urn) { throw new Error("Missing required property 'nodebalancerId'"); } resourceInputs["algorithm"] = args?.algorithm; resourceInputs["check"] = args?.check; resourceInputs["checkAttempts"] = args?.checkAttempts; resourceInputs["checkBody"] = args?.checkBody; resourceInputs["checkInterval"] = args?.checkInterval; resourceInputs["checkPassive"] = args?.checkPassive; resourceInputs["checkPath"] = args?.checkPath; resourceInputs["checkTimeout"] = args?.checkTimeout; resourceInputs["cipherSuite"] = args?.cipherSuite; resourceInputs["nodebalancerId"] = args?.nodebalancerId; resourceInputs["port"] = args?.port; resourceInputs["protocol"] = args?.protocol; resourceInputs["proxyProtocol"] = args?.proxyProtocol; resourceInputs["sslCert"] = args?.sslCert ? pulumi.secret(args.sslCert) : undefined; resourceInputs["sslKey"] = args?.sslKey ? pulumi.secret(args.sslKey) : undefined; resourceInputs["stickiness"] = args?.stickiness; resourceInputs["udpCheckPort"] = args?.udpCheckPort; resourceInputs["nodeStatuses"] = undefined /*out*/; resourceInputs["sslCommonname"] = undefined /*out*/; resourceInputs["sslFingerprint"] = undefined /*out*/; resourceInputs["udpSessionTimeout"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const secretOpts = { additionalSecretOutputs: ["sslCert", "sslKey"] }; opts = pulumi.mergeOptions(opts, secretOpts); super(NodeBalancerConfig.__pulumiType, name, resourceInputs, opts); } } exports.NodeBalancerConfig = NodeBalancerConfig; /** @internal */ NodeBalancerConfig.__pulumiType = 'linode:index/nodeBalancerConfig:NodeBalancerConfig'; //# sourceMappingURL=nodeBalancerConfig.js.map