UNPKG

@huaweicloudos/pulumi

Version:

A Pulumi package for creating and managing Huaweicloud cloud resources.

542 lines (541 loc) 22.9 kB
import * as pulumi from "@pulumi/pulumi"; import { input as inputs, output as outputs } from "../types"; /** * Manages an ELB pool resource within HuaweiCloud. * * ## Example Usage * ### Create a Pool and Associate a Load Balancer * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as pulumi from "@huaweicloudos/pulumi"; * * const config = new pulumi.Config(); * const loadbalancerId = config.requireObject("loadbalancerId"); * const pool1 = new huaweicloud.dedicatedelb.Pool("pool1", { * protocol: "HTTP", * lbMethod: "ROUND_ROBIN", * loadbalancerId: loadbalancerId, * slowStartEnabled: true, * slowStartDuration: 100, * protectionStatus: "consoleProtection", * protectionReason: "test reason", * persistence: { * type: "APP_COOKIE", * cookieName: "testCookie", * }, * }); * ``` * ### Create a Pool and Associate a Listener * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as pulumi from "@huaweicloudos/pulumi"; * * const config = new pulumi.Config(); * const listenerId = config.requireObject("listenerId"); * const pool1 = new huaweicloud.dedicatedelb.Pool("pool1", { * protocol: "HTTP", * lbMethod: "ROUND_ROBIN", * listenerId: listenerId, * slowStartEnabled: true, * slowStartDuration: 100, * protectionStatus: "consoleProtection", * protectionReason: "test reason", * persistence: { * type: "APP_COOKIE", * cookieName: "testCookie", * }, * }); * ``` * ### Create a Pool and Associate later * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as pulumi from "@huaweicloudos/pulumi"; * * const config = new pulumi.Config(); * const vpcId = config.requireObject("vpcId"); * const pool1 = new huaweicloud.dedicatedelb.Pool("pool1", { * protocol: "HTTP", * lbMethod: "ROUND_ROBIN", * type: "instance", * vpcId: vpcId, * slowStartEnabled: true, * slowStartDuration: 100, * protectionStatus: "consoleProtection", * protectionReason: "test reason", * persistence: { * type: "APP_COOKIE", * cookieName: "testCookie", * }, * }); * ``` * * ## Import * * ELB pool can be imported using the pool `id`, e.g. bash * * ```sh * $ pulumi import huaweicloud:DedicatedElb/pool:Pool pool_1 <id> * ``` * * Note that the imported state may not be identical to your resource definition, due to some attributes missing from the API response, security or some other reason. The missing attributes include`deletion_protection_enable`. It is generally recommended running **terraform plan** after importing a pool. You can then decide if changes should be applied to the pool, or the resource definition should be updated to align with the pool. Also you can ignore changes as below. hcl resource "huaweicloud_elb_pool" "test" { * * ... * * lifecycle { * * ignore_changes = [ * * deletion_protection_enable, * * ] * * } } */ export declare class Pool extends pulumi.CustomResource { /** * Get an existing Pool 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?: PoolState, opts?: pulumi.CustomResourceOptions): Pool; /** * Returns true if the given object is an instance of Pool. 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 Pool; /** * Specifies whether to enable transparent port transmission on the backend. * If enable, the port of the backend server will be same as the port of the listener. */ readonly anyPortEnable: pulumi.Output<boolean>; /** * Specifies whether to enable delayed logout. This parameter can be set to * **true** when the `protocol` is set to **TCP**, **UDP** or **QUIC**, and the value of `protocol` of the associated * listener must be **TCP** or **UDP**. It will be triggered for the following scenes: * + The pool member is removed from the pool. * + The health monitor status is abnormal. * + The pool member weight is changed to `0`. */ readonly connectionDrainEnabled: pulumi.Output<boolean>; /** * Specifies the timeout of the delayed logout in seconds. * Value ranges from `10` to `4000`. */ readonly connectionDrainTimeout: pulumi.Output<number>; /** * The creation time of the pool. */ readonly createdAt: pulumi.Output<string>; /** * Specifies whether to enable deletion protection. */ readonly deletionProtectionEnable: pulumi.Output<boolean | undefined>; /** * Specifies the description of the pool. */ readonly description: pulumi.Output<string | undefined>; readonly enableForceNew: pulumi.Output<string | undefined>; /** * The ID of the enterprise project. */ readonly enterpriseProjectId: pulumi.Output<string>; /** * Specifies the IP address version supported by the backend server group. * The value can be **dualstack**, **v6**, or **v4**. If the protocol of the backend server group is HTTP, the value is **v4**. */ readonly ipVersion: pulumi.Output<string>; /** * Specifies the load balancing algorithm used by the load balancer to route requests * to backend servers in the associated backend server group. Value options: * + **ROUND_ROBIN**: weighted round-robin. * + **LEAST_CONNECTIONS**: weighted least connections. * + **SOURCE_IP**: source IP hash. * + **QUIC_CID**: connection ID. * + **2_TUPLE_HASH**: 2-tuple hash that is only available for IP backend server groups. * + **3_TUPLE_HASH**: 3-tuple hash that is only available for IP backend server groups. * + **5_TUPLE_HASH**: 5-tuple hash that is only available for IP backend server groups Note. */ readonly lbMethod: pulumi.Output<string>; /** * Specifies the ID of the listener with which the backend server group is * associated. */ readonly listenerId: pulumi.Output<string>; /** * Specifies the ID of the load balancer with which the backend server * group is associated. */ readonly loadbalancerId: pulumi.Output<string>; /** * Specifies the minimum healthy member count. When the number of online * members in the health check is less than this number, the status of the pool is determined to be unhealthy. Value options: * + **0** (default value): Not take effect. * + **1**: Take effect when all member offline. */ readonly minimumHealthyMemberCount: pulumi.Output<number>; /** * The ID of the health check configured for the backend server group. */ readonly monitorId: pulumi.Output<string>; /** * Specifies the backend server group name. */ readonly name: pulumi.Output<string>; /** * Specifies the sticky session. * The object structure is documented below. */ readonly persistence: pulumi.Output<outputs.DedicatedElb.PoolPersistence | undefined>; /** * The reason for update protection. Only valid when `protectionStatus` is * **consoleProtection**. */ readonly protectionReason: pulumi.Output<string | undefined>; /** * The protection status for update. Value options: * + **nonProtection**: No protection. * + **consoleProtection**: Console modification protection. */ readonly protectionStatus: pulumi.Output<string>; /** * Specifies the protocol used by the backend server group to receive requests. * Value options: **TCP**, **UDP**, **HTTP**, **HTTPS**, **QUIC**, **GRPC** or **TLS**. * + If the listener's protocol is **UDP**, the value must be **UDP** or **QUIC**. * + If the listener's protocol is **TCP**, the value must be **TCP**. * + If the listener's protocol is **IP**, the value must be **IP**. * + If the listener's protocol is **HTTP**, the value must be **HTTP**. * + If the listener's protocol is **HTTPS**, the value must be **HTTP** or **HTTPS**. * + If the listener's protocol is **TERMINATED_HTTPS**, the value must be **HTTP**. * + If the listener's protocol is **QUIC**, the value must be **HTTP**、**HTTPS** or **GRPC**. * + If the listener's protocol is **TLS**, the value must be **TLS** or **TCP**. * + If the value is **QUIC**, sticky session must be enabled with `type` set to **SOURCE_IP**. * + If the value is **GRPC**, the value of `http2Enable` of the associated listener must be **true**. */ readonly protocol: pulumi.Output<string>; /** * Specifies the public border group. */ readonly publicBorderGroup: pulumi.Output<string>; /** * Specifies the region in which to create the ELB pool resource. If omitted, the * provider-level region will be used. Changing this creates a new pool. */ readonly region: pulumi.Output<string>; /** * Specifies the slow start duration, in seconds. * Value ranges from `30` to `1,200`. Defaults to `30`. */ readonly slowStartDuration: pulumi.Output<number>; /** * Specifies whether to enable slow start. After you enable slow start, new * backend servers added to the backend server group are warmed up, and the number of requests they can receive * increases linearly during the configured slow start duration. Defaults to **false**. */ readonly slowStartEnabled: pulumi.Output<boolean>; /** * Specifies the sticky session type. Value options: **SOURCE_IP**, * **HTTP_COOKIE**, and **APP_COOKIE**. */ readonly type: pulumi.Output<string>; /** * The update time of the pool. */ readonly updatedAt: pulumi.Output<string>; /** * Specifies the ID of the VPC where the backend server group works. */ readonly vpcId: pulumi.Output<string>; /** * Create a Pool 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: PoolArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering Pool resources. */ export interface PoolState { /** * Specifies whether to enable transparent port transmission on the backend. * If enable, the port of the backend server will be same as the port of the listener. */ anyPortEnable?: pulumi.Input<boolean>; /** * Specifies whether to enable delayed logout. This parameter can be set to * **true** when the `protocol` is set to **TCP**, **UDP** or **QUIC**, and the value of `protocol` of the associated * listener must be **TCP** or **UDP**. It will be triggered for the following scenes: * + The pool member is removed from the pool. * + The health monitor status is abnormal. * + The pool member weight is changed to `0`. */ connectionDrainEnabled?: pulumi.Input<boolean>; /** * Specifies the timeout of the delayed logout in seconds. * Value ranges from `10` to `4000`. */ connectionDrainTimeout?: pulumi.Input<number>; /** * The creation time of the pool. */ createdAt?: pulumi.Input<string>; /** * Specifies whether to enable deletion protection. */ deletionProtectionEnable?: pulumi.Input<boolean>; /** * Specifies the description of the pool. */ description?: pulumi.Input<string>; enableForceNew?: pulumi.Input<string>; /** * The ID of the enterprise project. */ enterpriseProjectId?: pulumi.Input<string>; /** * Specifies the IP address version supported by the backend server group. * The value can be **dualstack**, **v6**, or **v4**. If the protocol of the backend server group is HTTP, the value is **v4**. */ ipVersion?: pulumi.Input<string>; /** * Specifies the load balancing algorithm used by the load balancer to route requests * to backend servers in the associated backend server group. Value options: * + **ROUND_ROBIN**: weighted round-robin. * + **LEAST_CONNECTIONS**: weighted least connections. * + **SOURCE_IP**: source IP hash. * + **QUIC_CID**: connection ID. * + **2_TUPLE_HASH**: 2-tuple hash that is only available for IP backend server groups. * + **3_TUPLE_HASH**: 3-tuple hash that is only available for IP backend server groups. * + **5_TUPLE_HASH**: 5-tuple hash that is only available for IP backend server groups Note. */ lbMethod?: pulumi.Input<string>; /** * Specifies the ID of the listener with which the backend server group is * associated. */ listenerId?: pulumi.Input<string>; /** * Specifies the ID of the load balancer with which the backend server * group is associated. */ loadbalancerId?: pulumi.Input<string>; /** * Specifies the minimum healthy member count. When the number of online * members in the health check is less than this number, the status of the pool is determined to be unhealthy. Value options: * + **0** (default value): Not take effect. * + **1**: Take effect when all member offline. */ minimumHealthyMemberCount?: pulumi.Input<number>; /** * The ID of the health check configured for the backend server group. */ monitorId?: pulumi.Input<string>; /** * Specifies the backend server group name. */ name?: pulumi.Input<string>; /** * Specifies the sticky session. * The object structure is documented below. */ persistence?: pulumi.Input<inputs.DedicatedElb.PoolPersistence>; /** * The reason for update protection. Only valid when `protectionStatus` is * **consoleProtection**. */ protectionReason?: pulumi.Input<string>; /** * The protection status for update. Value options: * + **nonProtection**: No protection. * + **consoleProtection**: Console modification protection. */ protectionStatus?: pulumi.Input<string>; /** * Specifies the protocol used by the backend server group to receive requests. * Value options: **TCP**, **UDP**, **HTTP**, **HTTPS**, **QUIC**, **GRPC** or **TLS**. * + If the listener's protocol is **UDP**, the value must be **UDP** or **QUIC**. * + If the listener's protocol is **TCP**, the value must be **TCP**. * + If the listener's protocol is **IP**, the value must be **IP**. * + If the listener's protocol is **HTTP**, the value must be **HTTP**. * + If the listener's protocol is **HTTPS**, the value must be **HTTP** or **HTTPS**. * + If the listener's protocol is **TERMINATED_HTTPS**, the value must be **HTTP**. * + If the listener's protocol is **QUIC**, the value must be **HTTP**、**HTTPS** or **GRPC**. * + If the listener's protocol is **TLS**, the value must be **TLS** or **TCP**. * + If the value is **QUIC**, sticky session must be enabled with `type` set to **SOURCE_IP**. * + If the value is **GRPC**, the value of `http2Enable` of the associated listener must be **true**. */ protocol?: pulumi.Input<string>; /** * Specifies the public border group. */ publicBorderGroup?: pulumi.Input<string>; /** * Specifies the region in which to create the ELB pool resource. If omitted, the * provider-level region will be used. Changing this creates a new pool. */ region?: pulumi.Input<string>; /** * Specifies the slow start duration, in seconds. * Value ranges from `30` to `1,200`. Defaults to `30`. */ slowStartDuration?: pulumi.Input<number>; /** * Specifies whether to enable slow start. After you enable slow start, new * backend servers added to the backend server group are warmed up, and the number of requests they can receive * increases linearly during the configured slow start duration. Defaults to **false**. */ slowStartEnabled?: pulumi.Input<boolean>; /** * Specifies the sticky session type. Value options: **SOURCE_IP**, * **HTTP_COOKIE**, and **APP_COOKIE**. */ type?: pulumi.Input<string>; /** * The update time of the pool. */ updatedAt?: pulumi.Input<string>; /** * Specifies the ID of the VPC where the backend server group works. */ vpcId?: pulumi.Input<string>; } /** * The set of arguments for constructing a Pool resource. */ export interface PoolArgs { /** * Specifies whether to enable transparent port transmission on the backend. * If enable, the port of the backend server will be same as the port of the listener. */ anyPortEnable?: pulumi.Input<boolean>; /** * Specifies whether to enable delayed logout. This parameter can be set to * **true** when the `protocol` is set to **TCP**, **UDP** or **QUIC**, and the value of `protocol` of the associated * listener must be **TCP** or **UDP**. It will be triggered for the following scenes: * + The pool member is removed from the pool. * + The health monitor status is abnormal. * + The pool member weight is changed to `0`. */ connectionDrainEnabled?: pulumi.Input<boolean>; /** * Specifies the timeout of the delayed logout in seconds. * Value ranges from `10` to `4000`. */ connectionDrainTimeout?: pulumi.Input<number>; /** * Specifies whether to enable deletion protection. */ deletionProtectionEnable?: pulumi.Input<boolean>; /** * Specifies the description of the pool. */ description?: pulumi.Input<string>; enableForceNew?: pulumi.Input<string>; /** * Specifies the IP address version supported by the backend server group. * The value can be **dualstack**, **v6**, or **v4**. If the protocol of the backend server group is HTTP, the value is **v4**. */ ipVersion?: pulumi.Input<string>; /** * Specifies the load balancing algorithm used by the load balancer to route requests * to backend servers in the associated backend server group. Value options: * + **ROUND_ROBIN**: weighted round-robin. * + **LEAST_CONNECTIONS**: weighted least connections. * + **SOURCE_IP**: source IP hash. * + **QUIC_CID**: connection ID. * + **2_TUPLE_HASH**: 2-tuple hash that is only available for IP backend server groups. * + **3_TUPLE_HASH**: 3-tuple hash that is only available for IP backend server groups. * + **5_TUPLE_HASH**: 5-tuple hash that is only available for IP backend server groups Note. */ lbMethod: pulumi.Input<string>; /** * Specifies the ID of the listener with which the backend server group is * associated. */ listenerId?: pulumi.Input<string>; /** * Specifies the ID of the load balancer with which the backend server * group is associated. */ loadbalancerId?: pulumi.Input<string>; /** * Specifies the minimum healthy member count. When the number of online * members in the health check is less than this number, the status of the pool is determined to be unhealthy. Value options: * + **0** (default value): Not take effect. * + **1**: Take effect when all member offline. */ minimumHealthyMemberCount?: pulumi.Input<number>; /** * Specifies the backend server group name. */ name?: pulumi.Input<string>; /** * Specifies the sticky session. * The object structure is documented below. */ persistence?: pulumi.Input<inputs.DedicatedElb.PoolPersistence>; /** * The reason for update protection. Only valid when `protectionStatus` is * **consoleProtection**. */ protectionReason?: pulumi.Input<string>; /** * The protection status for update. Value options: * + **nonProtection**: No protection. * + **consoleProtection**: Console modification protection. */ protectionStatus?: pulumi.Input<string>; /** * Specifies the protocol used by the backend server group to receive requests. * Value options: **TCP**, **UDP**, **HTTP**, **HTTPS**, **QUIC**, **GRPC** or **TLS**. * + If the listener's protocol is **UDP**, the value must be **UDP** or **QUIC**. * + If the listener's protocol is **TCP**, the value must be **TCP**. * + If the listener's protocol is **IP**, the value must be **IP**. * + If the listener's protocol is **HTTP**, the value must be **HTTP**. * + If the listener's protocol is **HTTPS**, the value must be **HTTP** or **HTTPS**. * + If the listener's protocol is **TERMINATED_HTTPS**, the value must be **HTTP**. * + If the listener's protocol is **QUIC**, the value must be **HTTP**、**HTTPS** or **GRPC**. * + If the listener's protocol is **TLS**, the value must be **TLS** or **TCP**. * + If the value is **QUIC**, sticky session must be enabled with `type` set to **SOURCE_IP**. * + If the value is **GRPC**, the value of `http2Enable` of the associated listener must be **true**. */ protocol: pulumi.Input<string>; /** * Specifies the public border group. */ publicBorderGroup?: pulumi.Input<string>; /** * Specifies the region in which to create the ELB pool resource. If omitted, the * provider-level region will be used. Changing this creates a new pool. */ region?: pulumi.Input<string>; /** * Specifies the slow start duration, in seconds. * Value ranges from `30` to `1,200`. Defaults to `30`. */ slowStartDuration?: pulumi.Input<number>; /** * Specifies whether to enable slow start. After you enable slow start, new * backend servers added to the backend server group are warmed up, and the number of requests they can receive * increases linearly during the configured slow start duration. Defaults to **false**. */ slowStartEnabled?: pulumi.Input<boolean>; /** * Specifies the sticky session type. Value options: **SOURCE_IP**, * **HTTP_COOKIE**, and **APP_COOKIE**. */ type?: pulumi.Input<string>; /** * Specifies the ID of the VPC where the backend server group works. */ vpcId?: pulumi.Input<string>; }