UNPKG

@pulumi/linode

Version:

A Pulumi package for creating and managing linode cloud resources.

128 lines 6.88 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.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, * 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, Object.assign(Object.assign({}, 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 ? state.algorithm : undefined; resourceInputs["check"] = state ? state.check : undefined; resourceInputs["checkAttempts"] = state ? state.checkAttempts : undefined; resourceInputs["checkBody"] = state ? state.checkBody : undefined; resourceInputs["checkInterval"] = state ? state.checkInterval : undefined; resourceInputs["checkPassive"] = state ? state.checkPassive : undefined; resourceInputs["checkPath"] = state ? state.checkPath : undefined; resourceInputs["checkTimeout"] = state ? state.checkTimeout : undefined; resourceInputs["cipherSuite"] = state ? state.cipherSuite : undefined; resourceInputs["nodeStatuses"] = state ? state.nodeStatuses : undefined; resourceInputs["nodebalancerId"] = state ? state.nodebalancerId : undefined; resourceInputs["port"] = state ? state.port : undefined; resourceInputs["protocol"] = state ? state.protocol : undefined; resourceInputs["proxyProtocol"] = state ? state.proxyProtocol : undefined; resourceInputs["sslCert"] = state ? state.sslCert : undefined; resourceInputs["sslCommonname"] = state ? state.sslCommonname : undefined; resourceInputs["sslFingerprint"] = state ? state.sslFingerprint : undefined; resourceInputs["sslKey"] = state ? state.sslKey : undefined; resourceInputs["stickiness"] = state ? state.stickiness : undefined; } else { const args = argsOrState; if ((!args || args.nodebalancerId === undefined) && !opts.urn) { throw new Error("Missing required property 'nodebalancerId'"); } resourceInputs["algorithm"] = args ? args.algorithm : undefined; resourceInputs["check"] = args ? args.check : undefined; resourceInputs["checkAttempts"] = args ? args.checkAttempts : undefined; resourceInputs["checkBody"] = args ? args.checkBody : undefined; resourceInputs["checkInterval"] = args ? args.checkInterval : undefined; resourceInputs["checkPassive"] = args ? args.checkPassive : undefined; resourceInputs["checkPath"] = args ? args.checkPath : undefined; resourceInputs["checkTimeout"] = args ? args.checkTimeout : undefined; resourceInputs["cipherSuite"] = args ? args.cipherSuite : undefined; resourceInputs["nodebalancerId"] = args ? args.nodebalancerId : undefined; resourceInputs["port"] = args ? args.port : undefined; resourceInputs["protocol"] = args ? args.protocol : undefined; resourceInputs["proxyProtocol"] = args ? args.proxyProtocol : undefined; resourceInputs["sslCert"] = (args === null || args === void 0 ? void 0 : args.sslCert) ? pulumi.secret(args.sslCert) : undefined; resourceInputs["sslKey"] = (args === null || args === void 0 ? void 0 : args.sslKey) ? pulumi.secret(args.sslKey) : undefined; resourceInputs["stickiness"] = args ? args.stickiness : undefined; resourceInputs["nodeStatuses"] = undefined /*out*/; resourceInputs["sslCommonname"] = undefined /*out*/; resourceInputs["sslFingerprint"] = 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