UNPKG

@pulumi/linode

Version:

A Pulumi package for creating and managing linode cloud resources.

304 lines (303 loc) 15.9 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "./types/input"; import * as outputs from "./types/output"; /** * 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 * ``` */ export declare 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: string, id: pulumi.Input<pulumi.ID>, state?: NodeBalancerConfigState, opts?: pulumi.CustomResourceOptions): NodeBalancerConfig; /** * 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: any): obj is NodeBalancerConfig; /** * What algorithm this NodeBalancer should use for routing traffic to backends. (`roundrobin`, `leastconn`, `source`) */ readonly algorithm: pulumi.Output<string>; /** * The type of check to perform against backends to ensure they are serving requests. This is used to determine if backends are up or down. If none no check is performed. connection requires only a connection to the backend to succeed. http and httpBody rely on the backend serving HTTP, and that the response returned matches what is expected. (`none`, `connection`, `http`, `httpBody`) */ readonly check: pulumi.Output<string>; /** * How many times to attempt a check before considering a backend to be down. (1-30) */ readonly checkAttempts: pulumi.Output<number>; /** * This value must be present in the response body of the check in order for it to pass. If this value is not present in * the response body of a check request, the backend is considered to be down */ readonly checkBody: pulumi.Output<string>; /** * How often, in seconds, to check that backends are up and serving requests. */ readonly checkInterval: pulumi.Output<number>; /** * If true, any response from this backend with a 5xx status code will be enough for it to be considered unhealthy and taken out of rotation. */ readonly checkPassive: pulumi.Output<boolean>; /** * The URL path to check on each backend. If the backend does not respond to this request it is considered to be down. */ readonly checkPath: pulumi.Output<string>; /** * How long, in seconds, to wait for a check attempt before considering it failed. (1-30) */ readonly checkTimeout: pulumi.Output<number>; /** * What ciphers to use for SSL connections served by this NodeBalancer. `legacy` is considered insecure and should only be used if necessary. */ readonly cipherSuite: pulumi.Output<string>; /** * A structure containing information about the health of the backends for this port. This information is updated * periodically as checks are performed against backends. */ readonly nodeStatuses: pulumi.Output<outputs.NodeBalancerConfigNodeStatus[]>; /** * The ID of the NodeBalancer to access. * * - - - */ readonly nodebalancerId: pulumi.Output<number>; /** * The TCP port this Config is for. These values must be unique across configs on a single NodeBalancer (you can't have two configs for port 80, for example). While some ports imply some protocols, no enforcement is done and you may configure your NodeBalancer however is useful to you. For example, while port 443 is generally used for HTTPS, you do not need SSL configured to have a NodeBalancer listening on port 443. (Defaults to 80) */ readonly port: pulumi.Output<number>; /** * The protocol this port is configured to serve. If this is set to https you must include an sslCert and an ssl_key. (`http`, `https`, `tcp`) (Defaults to `http`) */ readonly protocol: pulumi.Output<string>; /** * The version of ProxyProtocol to use for the underlying NodeBalancer. This requires protocol to be `tcp`. (`none`, `v1`, `v2`) (Defaults to `none`) */ readonly proxyProtocol: pulumi.Output<string>; /** * The certificate this port is serving. This is not returned. If set, this field will come back as `<REDACTED>`. Please use the sslCommonname and sslFingerprint to identify the certificate. */ readonly sslCert: pulumi.Output<string | undefined>; /** * The read-only common name automatically derived from the SSL certificate assigned to this NodeBalancerConfig. Please refer to this field to verify that the appropriate certificate is assigned to your NodeBalancerConfig. */ readonly sslCommonname: pulumi.Output<string>; /** * The read-only fingerprint automatically derived from the SSL certificate assigned to this NodeBalancerConfig. Please refer to this field to verify that the appropriate certificate is assigned to your NodeBalancerConfig. */ readonly sslFingerprint: pulumi.Output<string>; /** * The private key corresponding to this port's certificate. This is not returned. If set, this field will come back as `<REDACTED>`. Please use the sslCommonname and sslFingerprint to identify the certificate. */ readonly sslKey: pulumi.Output<string | undefined>; /** * Controls how session stickiness is handled on this port. (`none`, `table`, `httpCookie`) */ readonly stickiness: pulumi.Output<string>; /** * Create a NodeBalancerConfig resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: NodeBalancerConfigArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering NodeBalancerConfig resources. */ export interface NodeBalancerConfigState { /** * What algorithm this NodeBalancer should use for routing traffic to backends. (`roundrobin`, `leastconn`, `source`) */ algorithm?: pulumi.Input<string>; /** * The type of check to perform against backends to ensure they are serving requests. This is used to determine if backends are up or down. If none no check is performed. connection requires only a connection to the backend to succeed. http and httpBody rely on the backend serving HTTP, and that the response returned matches what is expected. (`none`, `connection`, `http`, `httpBody`) */ check?: pulumi.Input<string>; /** * How many times to attempt a check before considering a backend to be down. (1-30) */ checkAttempts?: pulumi.Input<number>; /** * This value must be present in the response body of the check in order for it to pass. If this value is not present in * the response body of a check request, the backend is considered to be down */ checkBody?: pulumi.Input<string>; /** * How often, in seconds, to check that backends are up and serving requests. */ checkInterval?: pulumi.Input<number>; /** * If true, any response from this backend with a 5xx status code will be enough for it to be considered unhealthy and taken out of rotation. */ checkPassive?: pulumi.Input<boolean>; /** * The URL path to check on each backend. If the backend does not respond to this request it is considered to be down. */ checkPath?: pulumi.Input<string>; /** * How long, in seconds, to wait for a check attempt before considering it failed. (1-30) */ checkTimeout?: pulumi.Input<number>; /** * What ciphers to use for SSL connections served by this NodeBalancer. `legacy` is considered insecure and should only be used if necessary. */ cipherSuite?: pulumi.Input<string>; /** * A structure containing information about the health of the backends for this port. This information is updated * periodically as checks are performed against backends. */ nodeStatuses?: pulumi.Input<pulumi.Input<inputs.NodeBalancerConfigNodeStatus>[]>; /** * The ID of the NodeBalancer to access. * * - - - */ nodebalancerId?: pulumi.Input<number>; /** * The TCP port this Config is for. These values must be unique across configs on a single NodeBalancer (you can't have two configs for port 80, for example). While some ports imply some protocols, no enforcement is done and you may configure your NodeBalancer however is useful to you. For example, while port 443 is generally used for HTTPS, you do not need SSL configured to have a NodeBalancer listening on port 443. (Defaults to 80) */ port?: pulumi.Input<number>; /** * The protocol this port is configured to serve. If this is set to https you must include an sslCert and an ssl_key. (`http`, `https`, `tcp`) (Defaults to `http`) */ protocol?: pulumi.Input<string>; /** * The version of ProxyProtocol to use for the underlying NodeBalancer. This requires protocol to be `tcp`. (`none`, `v1`, `v2`) (Defaults to `none`) */ proxyProtocol?: pulumi.Input<string>; /** * The certificate this port is serving. This is not returned. If set, this field will come back as `<REDACTED>`. Please use the sslCommonname and sslFingerprint to identify the certificate. */ sslCert?: pulumi.Input<string>; /** * The read-only common name automatically derived from the SSL certificate assigned to this NodeBalancerConfig. Please refer to this field to verify that the appropriate certificate is assigned to your NodeBalancerConfig. */ sslCommonname?: pulumi.Input<string>; /** * The read-only fingerprint automatically derived from the SSL certificate assigned to this NodeBalancerConfig. Please refer to this field to verify that the appropriate certificate is assigned to your NodeBalancerConfig. */ sslFingerprint?: pulumi.Input<string>; /** * The private key corresponding to this port's certificate. This is not returned. If set, this field will come back as `<REDACTED>`. Please use the sslCommonname and sslFingerprint to identify the certificate. */ sslKey?: pulumi.Input<string>; /** * Controls how session stickiness is handled on this port. (`none`, `table`, `httpCookie`) */ stickiness?: pulumi.Input<string>; } /** * The set of arguments for constructing a NodeBalancerConfig resource. */ export interface NodeBalancerConfigArgs { /** * What algorithm this NodeBalancer should use for routing traffic to backends. (`roundrobin`, `leastconn`, `source`) */ algorithm?: pulumi.Input<string>; /** * The type of check to perform against backends to ensure they are serving requests. This is used to determine if backends are up or down. If none no check is performed. connection requires only a connection to the backend to succeed. http and httpBody rely on the backend serving HTTP, and that the response returned matches what is expected. (`none`, `connection`, `http`, `httpBody`) */ check?: pulumi.Input<string>; /** * How many times to attempt a check before considering a backend to be down. (1-30) */ checkAttempts?: pulumi.Input<number>; /** * This value must be present in the response body of the check in order for it to pass. If this value is not present in * the response body of a check request, the backend is considered to be down */ checkBody?: pulumi.Input<string>; /** * How often, in seconds, to check that backends are up and serving requests. */ checkInterval?: pulumi.Input<number>; /** * If true, any response from this backend with a 5xx status code will be enough for it to be considered unhealthy and taken out of rotation. */ checkPassive?: pulumi.Input<boolean>; /** * The URL path to check on each backend. If the backend does not respond to this request it is considered to be down. */ checkPath?: pulumi.Input<string>; /** * How long, in seconds, to wait for a check attempt before considering it failed. (1-30) */ checkTimeout?: pulumi.Input<number>; /** * What ciphers to use for SSL connections served by this NodeBalancer. `legacy` is considered insecure and should only be used if necessary. */ cipherSuite?: pulumi.Input<string>; /** * The ID of the NodeBalancer to access. * * - - - */ nodebalancerId: pulumi.Input<number>; /** * The TCP port this Config is for. These values must be unique across configs on a single NodeBalancer (you can't have two configs for port 80, for example). While some ports imply some protocols, no enforcement is done and you may configure your NodeBalancer however is useful to you. For example, while port 443 is generally used for HTTPS, you do not need SSL configured to have a NodeBalancer listening on port 443. (Defaults to 80) */ port?: pulumi.Input<number>; /** * The protocol this port is configured to serve. If this is set to https you must include an sslCert and an ssl_key. (`http`, `https`, `tcp`) (Defaults to `http`) */ protocol?: pulumi.Input<string>; /** * The version of ProxyProtocol to use for the underlying NodeBalancer. This requires protocol to be `tcp`. (`none`, `v1`, `v2`) (Defaults to `none`) */ proxyProtocol?: pulumi.Input<string>; /** * The certificate this port is serving. This is not returned. If set, this field will come back as `<REDACTED>`. Please use the sslCommonname and sslFingerprint to identify the certificate. */ sslCert?: pulumi.Input<string>; /** * The private key corresponding to this port's certificate. This is not returned. If set, this field will come back as `<REDACTED>`. Please use the sslCommonname and sslFingerprint to identify the certificate. */ sslKey?: pulumi.Input<string>; /** * Controls how session stickiness is handled on this port. (`none`, `table`, `httpCookie`) */ stickiness?: pulumi.Input<string>; }