import * as pulumi from "@pulumi/pulumi"; import { input as inputs, output as outputs } from "./types"; /** * If you're using Cloudflare's Load Balancing to load-balance across multiple origin servers or data centers, you configure one of these Monitors to actively check the availability of those servers over HTTP(S) or TCP. * * > **Note:** When creating a monitor, you have to pass `accountId` to the provider configuration in order to create account level resources. Otherwise, by default, it will be a user level resource. * * ## Example Usage * ### HTTP Monitor * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as cloudflare from "@pulumi/cloudflare"; * * const httpMonitor = new cloudflare.LoadBalancerMonitor("http_monitor", { * allowInsecure: false, * description: "example http load balancer", * expectedBody: "alive", * expectedCodes: "2xx", * followRedirects: true, * headers: [{ * header: "Host", * values: ["example.com"], * }], * interval: 60, * method: "GET", * path: "/health", * probeZone: "example.com", * retries: 5, * timeout: 7, * type: "http", * }); * ``` * ### TCP Monitor * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as cloudflare from "@pulumi/cloudflare"; * * const tcpMonitor = new cloudflare.LoadBalancerMonitor("tcp_monitor", { * description: "example tcp load balancer", * interval: 60, * method: "connection_established", * port: 8080, * retries: 5, * timeout: 7, * type: "tcp", * }); * ``` */ export declare class LoadBalancerMonitor extends pulumi.CustomResource { /** * Get an existing LoadBalancerMonitor 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, state?: LoadBalancerMonitorState, opts?: pulumi.CustomResourceOptions): LoadBalancerMonitor; /** * Returns true if the given object is an instance of LoadBalancerMonitor. 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 LoadBalancerMonitor; /** * Do not validate the certificate when monitor use HTTPS. Only valid if `type` is "http" or "https". */ readonly allowInsecure: pulumi.Output; /** * The RFC3339 timestamp of when the load balancer monitor was created. */ readonly createdOn: pulumi.Output; /** * Free text description. */ readonly description: pulumi.Output; /** * A case-insensitive sub-string to look for in the response body. If this string is not found, the origin will be marked as unhealthy. Only valid if `type` is "http" or "https". Default: "". */ readonly expectedBody: pulumi.Output; /** * The expected HTTP response code or code range of the health check. Eg `2xx`. Only valid and required if `type` is "http" or "https". */ readonly expectedCodes: pulumi.Output; /** * Follow redirects if returned by the origin. Only valid if `type` is "http" or "https". */ readonly followRedirects: pulumi.Output; /** * The header name. */ readonly headers: pulumi.Output; /** * The interval between each health check. Shorter intervals may improve failover time, but will increase load on the origins as we check from multiple locations. Default: 60. */ readonly interval: pulumi.Output; /** * The method to use for the health check. Valid values are any valid HTTP verb if `type` is "http" or "https", or `connectionEstablished` if `type` is "tcp". Default: "GET" if `type` is "http" or "https", "connectionEstablished" if `type` is "tcp", and empty otherwise. */ readonly method: pulumi.Output; /** * The RFC3339 timestamp of when the load balancer monitor was last modified. */ readonly modifiedOn: pulumi.Output; /** * The endpoint path to health check against. Default: "/". Only valid if `type` is "http" or "https". */ readonly path: pulumi.Output; /** * The port number to use for the healthcheck, required when creating a TCP monitor. Valid values are in the range `0-65535`. */ readonly port: pulumi.Output; /** * Assign this monitor to emulate the specified zone while probing. Only valid if `type` is "http" or "https". */ readonly probeZone: pulumi.Output; /** * The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately. Default: 2. */ readonly retries: pulumi.Output; /** * The timeout (in seconds) before marking the health check as failed. Default: 5. */ readonly timeout: pulumi.Output; /** * The protocol to use for the healthcheck. Currently supported protocols are 'HTTP', 'HTTPS', 'TCP', 'UDP-ICMP', 'ICMP-PING', and 'SMTP'. Default: "http". */ readonly type: pulumi.Output; /** * Create a LoadBalancerMonitor 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?: LoadBalancerMonitorArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering LoadBalancerMonitor resources. */ export interface LoadBalancerMonitorState { /** * Do not validate the certificate when monitor use HTTPS. Only valid if `type` is "http" or "https". */ allowInsecure?: pulumi.Input; /** * The RFC3339 timestamp of when the load balancer monitor was created. */ createdOn?: pulumi.Input; /** * Free text description. */ description?: pulumi.Input; /** * A case-insensitive sub-string to look for in the response body. If this string is not found, the origin will be marked as unhealthy. Only valid if `type` is "http" or "https". Default: "". */ expectedBody?: pulumi.Input; /** * The expected HTTP response code or code range of the health check. Eg `2xx`. Only valid and required if `type` is "http" or "https". */ expectedCodes?: pulumi.Input; /** * Follow redirects if returned by the origin. Only valid if `type` is "http" or "https". */ followRedirects?: pulumi.Input; /** * The header name. */ headers?: pulumi.Input[]>; /** * The interval between each health check. Shorter intervals may improve failover time, but will increase load on the origins as we check from multiple locations. Default: 60. */ interval?: pulumi.Input; /** * The method to use for the health check. Valid values are any valid HTTP verb if `type` is "http" or "https", or `connectionEstablished` if `type` is "tcp". Default: "GET" if `type` is "http" or "https", "connectionEstablished" if `type` is "tcp", and empty otherwise. */ method?: pulumi.Input; /** * The RFC3339 timestamp of when the load balancer monitor was last modified. */ modifiedOn?: pulumi.Input; /** * The endpoint path to health check against. Default: "/". Only valid if `type` is "http" or "https". */ path?: pulumi.Input; /** * The port number to use for the healthcheck, required when creating a TCP monitor. Valid values are in the range `0-65535`. */ port?: pulumi.Input; /** * Assign this monitor to emulate the specified zone while probing. Only valid if `type` is "http" or "https". */ probeZone?: pulumi.Input; /** * The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately. Default: 2. */ retries?: pulumi.Input; /** * The timeout (in seconds) before marking the health check as failed. Default: 5. */ timeout?: pulumi.Input; /** * The protocol to use for the healthcheck. Currently supported protocols are 'HTTP', 'HTTPS', 'TCP', 'UDP-ICMP', 'ICMP-PING', and 'SMTP'. Default: "http". */ type?: pulumi.Input; } /** * The set of arguments for constructing a LoadBalancerMonitor resource. */ export interface LoadBalancerMonitorArgs { /** * Do not validate the certificate when monitor use HTTPS. Only valid if `type` is "http" or "https". */ allowInsecure?: pulumi.Input; /** * Free text description. */ description?: pulumi.Input; /** * A case-insensitive sub-string to look for in the response body. If this string is not found, the origin will be marked as unhealthy. Only valid if `type` is "http" or "https". Default: "". */ expectedBody?: pulumi.Input; /** * The expected HTTP response code or code range of the health check. Eg `2xx`. Only valid and required if `type` is "http" or "https". */ expectedCodes?: pulumi.Input; /** * Follow redirects if returned by the origin. Only valid if `type` is "http" or "https". */ followRedirects?: pulumi.Input; /** * The header name. */ headers?: pulumi.Input[]>; /** * The interval between each health check. Shorter intervals may improve failover time, but will increase load on the origins as we check from multiple locations. Default: 60. */ interval?: pulumi.Input; /** * The method to use for the health check. Valid values are any valid HTTP verb if `type` is "http" or "https", or `connectionEstablished` if `type` is "tcp". Default: "GET" if `type` is "http" or "https", "connectionEstablished" if `type` is "tcp", and empty otherwise. */ method?: pulumi.Input; /** * The endpoint path to health check against. Default: "/". Only valid if `type` is "http" or "https". */ path?: pulumi.Input; /** * The port number to use for the healthcheck, required when creating a TCP monitor. Valid values are in the range `0-65535`. */ port?: pulumi.Input; /** * Assign this monitor to emulate the specified zone while probing. Only valid if `type` is "http" or "https". */ probeZone?: pulumi.Input; /** * The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately. Default: 2. */ retries?: pulumi.Input; /** * The timeout (in seconds) before marking the health check as failed. Default: 5. */ timeout?: pulumi.Input; /** * The protocol to use for the healthcheck. Currently supported protocols are 'HTTP', 'HTTPS', 'TCP', 'UDP-ICMP', 'ICMP-PING', and 'SMTP'. Default: "http". */ type?: pulumi.Input; }