@huaweicloudos/pulumi
Version:
A Pulumi package for creating and managing Huaweicloud cloud resources.
304 lines (303 loc) • 11.8 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
/**
* Manages an ELB monitor resource within HuaweiCloud.
*
* ## Example Usage
* ### TCP Health Check
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const monitorTcp = new huaweicloud.elb.Monitor("monitorTcp", {
* poolId: _var.pool_id,
* type: "TCP",
* delay: 5,
* timeout: 3,
* maxRetries: 3,
* });
* ```
* ### UDP Health Check
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const monitorUdp = new huaweicloud.elb.Monitor("monitorUdp", {
* poolId: _var.pool_id,
* type: "UDP_CONNECT",
* delay: 5,
* timeout: 3,
* maxRetries: 3,
* });
* ```
* ### HTTP Health Check
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const monitorHttp = new huaweicloud.elb.Monitor("monitorHttp", {
* poolId: _var.pool_id,
* type: "HTTP",
* delay: 5,
* timeout: 3,
* maxRetries: 3,
* urlPath: "/test",
* expectedCodes: "200-202",
* });
* ```
*
* ## Import
*
* ELB monitor can be imported using the monitor ID, e.g. bash
*
* ```sh
* $ pulumi import huaweicloud:Elb/monitor:Monitor monitor_1 5c20fdad-7288-11eb-b817-0255ac10158b
* ```
*/
export declare class Monitor extends pulumi.CustomResource {
/**
* Get an existing Monitor 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?: MonitorState, opts?: pulumi.CustomResourceOptions): Monitor;
/**
* Returns true if the given object is an instance of Monitor. 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 Monitor;
/**
* @deprecated tenant_id is deprecated
*/
readonly adminStateUp: pulumi.Output<boolean | undefined>;
/**
* Specifies the maximum time between health checks in the unit of second. The value ranges
* from **1** to **50**.
*/
readonly delay: pulumi.Output<number>;
/**
* Specifies the domain name of HTTP requests during the health check. It takes effect
* only when the value of `type` is set to **HTTP**. The value is left blank by default, indicating that the private IP
* address of the load balancer is used as the destination address of HTTP requests. The value can contain only digits,
* letters, hyphens (-), and periods (.) and must start with a digit or letter, the value contains a maximum of 100 characters.
*/
readonly domainName: pulumi.Output<string>;
/**
* Specifies the expected HTTP status code. Required for HTTP type.
* You can either specify a single status like **200**, or a range like **200-202**.
*/
readonly expectedCodes: pulumi.Output<string>;
/**
* Specifies the HTTP request method. Required for HTTP type.
* The default value is **GET**.
*/
readonly httpMethod: pulumi.Output<string>;
/**
* Specifies the maximum number of consecutive health checks after which the backend
* servers are declared **healthy**. The value ranges from **1** to **10**.
*/
readonly maxRetries: pulumi.Output<number>;
/**
* Specifies the health check name. The value contains a maximum of 255 characters.
*/
readonly name: pulumi.Output<string>;
/**
* Specifies the id of the pool that this monitor will be assigned to. Changing
* this creates a new monitor.
*/
readonly poolId: pulumi.Output<string>;
/**
* Specifies the health check port. The port number ranges from `1` to `65,535`. If not specified,
* the port of the backend server will be used as the health check port.
*/
readonly port: pulumi.Output<number | undefined>;
/**
* The region in which to create the ELB monitor resource. If omitted, the
* provider-level region will be used. Changing this creates a new monitor.
*/
readonly region: pulumi.Output<string>;
/**
* @deprecated tenant_id is deprecated
*/
readonly tenantId: pulumi.Output<string>;
/**
* Specifies the health check timeout duration in the unit of second.
* The value ranges from **1** to **50** and must be less than the `delay` value.
*/
readonly timeout: pulumi.Output<number>;
/**
* Specifies the monitor protocol.
* The value can be **TCP**, **UDP_CONNECT** or **HTTP**.
* If the listener protocol is **UDP**, the monitor protocol must be **UDP_CONNECT**.
*/
readonly type: pulumi.Output<string>;
/**
* Specifies the HTTP request path for the health check. Required for HTTP type.
* The value starts with a slash (/) and contains a maximum of 255 characters.
*/
readonly urlPath: pulumi.Output<string>;
/**
* Create a Monitor 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: MonitorArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering Monitor resources.
*/
export interface MonitorState {
/**
* @deprecated tenant_id is deprecated
*/
adminStateUp?: pulumi.Input<boolean>;
/**
* Specifies the maximum time between health checks in the unit of second. The value ranges
* from **1** to **50**.
*/
delay?: pulumi.Input<number>;
/**
* Specifies the domain name of HTTP requests during the health check. It takes effect
* only when the value of `type` is set to **HTTP**. The value is left blank by default, indicating that the private IP
* address of the load balancer is used as the destination address of HTTP requests. The value can contain only digits,
* letters, hyphens (-), and periods (.) and must start with a digit or letter, the value contains a maximum of 100 characters.
*/
domainName?: pulumi.Input<string>;
/**
* Specifies the expected HTTP status code. Required for HTTP type.
* You can either specify a single status like **200**, or a range like **200-202**.
*/
expectedCodes?: pulumi.Input<string>;
/**
* Specifies the HTTP request method. Required for HTTP type.
* The default value is **GET**.
*/
httpMethod?: pulumi.Input<string>;
/**
* Specifies the maximum number of consecutive health checks after which the backend
* servers are declared **healthy**. The value ranges from **1** to **10**.
*/
maxRetries?: pulumi.Input<number>;
/**
* Specifies the health check name. The value contains a maximum of 255 characters.
*/
name?: pulumi.Input<string>;
/**
* Specifies the id of the pool that this monitor will be assigned to. Changing
* this creates a new monitor.
*/
poolId?: pulumi.Input<string>;
/**
* Specifies the health check port. The port number ranges from `1` to `65,535`. If not specified,
* the port of the backend server will be used as the health check port.
*/
port?: pulumi.Input<number>;
/**
* The region in which to create the ELB monitor resource. If omitted, the
* provider-level region will be used. Changing this creates a new monitor.
*/
region?: pulumi.Input<string>;
/**
* @deprecated tenant_id is deprecated
*/
tenantId?: pulumi.Input<string>;
/**
* Specifies the health check timeout duration in the unit of second.
* The value ranges from **1** to **50** and must be less than the `delay` value.
*/
timeout?: pulumi.Input<number>;
/**
* Specifies the monitor protocol.
* The value can be **TCP**, **UDP_CONNECT** or **HTTP**.
* If the listener protocol is **UDP**, the monitor protocol must be **UDP_CONNECT**.
*/
type?: pulumi.Input<string>;
/**
* Specifies the HTTP request path for the health check. Required for HTTP type.
* The value starts with a slash (/) and contains a maximum of 255 characters.
*/
urlPath?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a Monitor resource.
*/
export interface MonitorArgs {
/**
* @deprecated tenant_id is deprecated
*/
adminStateUp?: pulumi.Input<boolean>;
/**
* Specifies the maximum time between health checks in the unit of second. The value ranges
* from **1** to **50**.
*/
delay: pulumi.Input<number>;
/**
* Specifies the domain name of HTTP requests during the health check. It takes effect
* only when the value of `type` is set to **HTTP**. The value is left blank by default, indicating that the private IP
* address of the load balancer is used as the destination address of HTTP requests. The value can contain only digits,
* letters, hyphens (-), and periods (.) and must start with a digit or letter, the value contains a maximum of 100 characters.
*/
domainName?: pulumi.Input<string>;
/**
* Specifies the expected HTTP status code. Required for HTTP type.
* You can either specify a single status like **200**, or a range like **200-202**.
*/
expectedCodes?: pulumi.Input<string>;
/**
* Specifies the HTTP request method. Required for HTTP type.
* The default value is **GET**.
*/
httpMethod?: pulumi.Input<string>;
/**
* Specifies the maximum number of consecutive health checks after which the backend
* servers are declared **healthy**. The value ranges from **1** to **10**.
*/
maxRetries: pulumi.Input<number>;
/**
* Specifies the health check name. The value contains a maximum of 255 characters.
*/
name?: pulumi.Input<string>;
/**
* Specifies the id of the pool that this monitor will be assigned to. Changing
* this creates a new monitor.
*/
poolId: pulumi.Input<string>;
/**
* Specifies the health check port. The port number ranges from `1` to `65,535`. If not specified,
* the port of the backend server will be used as the health check port.
*/
port?: pulumi.Input<number>;
/**
* The region in which to create the ELB monitor resource. If omitted, the
* provider-level region will be used. Changing this creates a new monitor.
*/
region?: pulumi.Input<string>;
/**
* @deprecated tenant_id is deprecated
*/
tenantId?: pulumi.Input<string>;
/**
* Specifies the health check timeout duration in the unit of second.
* The value ranges from **1** to **50** and must be less than the `delay` value.
*/
timeout: pulumi.Input<number>;
/**
* Specifies the monitor protocol.
* The value can be **TCP**, **UDP_CONNECT** or **HTTP**.
* If the listener protocol is **UDP**, the monitor protocol must be **UDP_CONNECT**.
*/
type: pulumi.Input<string>;
/**
* Specifies the HTTP request path for the health check. Required for HTTP type.
* The value starts with a slash (/) and contains a maximum of 255 characters.
*/
urlPath?: pulumi.Input<string>;
}