import * as pulumi from "@pulumi/pulumi"; import { input as inputs, output as outputs } from "./types"; /** * Standalone Health Checks provide a way to monitor origin servers without needing a Cloudflare Load Balancer. * * ## Example Usage * * The resource supports HTTP, HTTPS and TCP type health checks. * ### HTTPS Health Check * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as pulumi_cloudflare from "@mapped/pulumi-cloudflare"; * * const httpHealthCheck = new cloudflare.Healthcheck("httpHealthCheck", { * zoneId: _var.cloudflare_zone_id, * name: "http-health-check", * description: "example http health check", * address: "example.com", * suspended: false, * checkRegions: [ * "WEU", * "EEU", * ], * notificationSuspended: false, * notificationEmailAddresses: ["hostmaster@example.com"], * type: "HTTPS", * port: 443, * method: "GET", * path: "/health", * expectedBody: "alive", * expectedCodes: [ * "2xx", * "301", * ], * followRedirects: true, * allowInsecure: false, * headers: [{ * header: "Host", * values: ["example.com"], * }], * timeout: 10, * retries: 2, * interval: 60, * consecutiveFails: 3, * consecutiveSuccesses: 2, * }); * ``` * ### TCP Monitor * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as pulumi_cloudflare from "@mapped/pulumi-cloudflare"; * * const tcpHealthCheck = new cloudflare.Healthcheck("tcpHealthCheck", { * zoneId: _var.cloudflare_zone_id, * name: "tcp-health-check", * description: "example tcp health check", * address: "example.com", * suspended: false, * checkRegions: [ * "WEU", * "EEU", * ], * notificationSuspended: false, * notificationEmailAddresses: ["hostmaster@example.com"], * type: "TCP", * port: 22, * method: "connection_established", * timeout: 10, * retries: 2, * interval: 60, * consecutiveFails: 3, * consecutiveSuccesses: 2, * }); * ``` * * ## Import * * Healthchecks can be imported using a composite ID formed of zone ID and healthcheck ID, e.g. * * ```sh * $ pulumi import cloudflare:index/healthcheck:Healthcheck example 9a7806061c88ada191ed06f989cc3dac/699d98642c564d2e855e9661899b7252 * ``` * * where* `9a7806061c88ada191ed06f989cc3dac` - the zone ID * `699d98642c564d2e855e9661899b7252` - healthcheck ID as returned by [API](https://api.cloudflare.com/#health-checks-list-health-checks) */ export declare class Healthcheck extends pulumi.CustomResource { /** * Get an existing Healthcheck 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?: HealthcheckState, opts?: pulumi.CustomResourceOptions): Healthcheck; /** * Returns true if the given object is an instance of Healthcheck. 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 Healthcheck; /** * The hostname or IP address of the origin server to run health checks on. */ readonly address: pulumi.Output; /** * Do not validate the certificate when the health check uses HTTPS. Valid values: `true` or `false` (Default: `false`). */ readonly allowInsecure: pulumi.Output; /** * A list of regions from which to run health checks. If not set Cloudflare will pick a default region. Valid values: `WNAM`, `ENAM`, `WEU`, `EEU`, `NSAM`, `SSAM`, `OC`, `ME`, `NAF`, `SAF`, `IN`, `SEAS`, `NEAS`, `ALL_REGIONS`. */ readonly checkRegions: pulumi.Output; /** * The number of consecutive fails required from a health check before changing the health to unhealthy. (Default: `1`) */ readonly consecutiveFails: pulumi.Output; /** * The number of consecutive successes required from a health check before changing the health to healthy. (Default: `1`) */ readonly consecutiveSuccesses: pulumi.Output; readonly createdOn: pulumi.Output; /** * A human-readable description of the health check. */ 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. */ readonly expectedBody: pulumi.Output; /** * The expected HTTP response codes (e.g. "200") or code ranges (e.g. "2xx" for all codes starting with 2) of the health check. (Default: `["200"]`) */ readonly expectedCodes: pulumi.Output; /** * Follow redirects if the origin returns a 3xx status code. Valid values: `true` or `false` (Default: `false`). */ readonly followRedirects: pulumi.Output; /** * The header name. */ readonly headers: pulumi.Output; /** * The interval between each health check. Shorter intervals may give quicker notifications if the origin status changes, but will increase load on the origin as we check from multiple locations. (Default: `60`) */ readonly interval: pulumi.Output; /** * The TCP connection method to use for the health check. Valid values: `connectionEstablished` (Default: `connectionEstablished`). */ readonly method: pulumi.Output; readonly modifiedOn: pulumi.Output; /** * A short name to identify the health check. Only alphanumeric characters, hyphens and underscores are allowed. */ readonly name: pulumi.Output; /** * A list of email addresses we want to send the notifications to. *Deprecated, use `cloudflare.NotificationPolicy` instead.* * * @deprecated Use `cloudflare_notification_policy` instead. */ readonly notificationEmailAddresses: pulumi.Output; /** * Whether the notifications are suspended or not. Useful for maintenance periods. Valid values: `true` or `false` (Default: `false`). *Deprecated, use `cloudflare.NotificationPolicy` instead.* * * @deprecated Use `cloudflare_notification_policy` instead. */ readonly notificationSuspended: pulumi.Output; /** * The endpoint path to health check against. (Default: `/`) */ readonly path: pulumi.Output; /** * Port number to connect to for the health check. Valid values are in the range `0-65535` (Default: `80`). */ readonly port: 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; /** * If suspended, no health checks are sent to the origin. Valid values: `true` or `false` (Default: `false`). */ readonly suspended: 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 health check. Valid values: `HTTP`, `HTTPS`, `TCP`. */ readonly type: pulumi.Output; /** * The DNS zone ID to which apply settings. */ readonly zoneId: pulumi.Output; /** * Create a Healthcheck 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: HealthcheckArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering Healthcheck resources. */ export interface HealthcheckState { /** * The hostname or IP address of the origin server to run health checks on. */ address?: pulumi.Input; /** * Do not validate the certificate when the health check uses HTTPS. Valid values: `true` or `false` (Default: `false`). */ allowInsecure?: pulumi.Input; /** * A list of regions from which to run health checks. If not set Cloudflare will pick a default region. Valid values: `WNAM`, `ENAM`, `WEU`, `EEU`, `NSAM`, `SSAM`, `OC`, `ME`, `NAF`, `SAF`, `IN`, `SEAS`, `NEAS`, `ALL_REGIONS`. */ checkRegions?: pulumi.Input[]>; /** * The number of consecutive fails required from a health check before changing the health to unhealthy. (Default: `1`) */ consecutiveFails?: pulumi.Input; /** * The number of consecutive successes required from a health check before changing the health to healthy. (Default: `1`) */ consecutiveSuccesses?: pulumi.Input; createdOn?: pulumi.Input; /** * A human-readable description of the health check. */ 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. */ expectedBody?: pulumi.Input; /** * The expected HTTP response codes (e.g. "200") or code ranges (e.g. "2xx" for all codes starting with 2) of the health check. (Default: `["200"]`) */ expectedCodes?: pulumi.Input[]>; /** * Follow redirects if the origin returns a 3xx status code. Valid values: `true` or `false` (Default: `false`). */ followRedirects?: pulumi.Input; /** * The header name. */ headers?: pulumi.Input[]>; /** * The interval between each health check. Shorter intervals may give quicker notifications if the origin status changes, but will increase load on the origin as we check from multiple locations. (Default: `60`) */ interval?: pulumi.Input; /** * The TCP connection method to use for the health check. Valid values: `connectionEstablished` (Default: `connectionEstablished`). */ method?: pulumi.Input; modifiedOn?: pulumi.Input; /** * A short name to identify the health check. Only alphanumeric characters, hyphens and underscores are allowed. */ name?: pulumi.Input; /** * A list of email addresses we want to send the notifications to. *Deprecated, use `cloudflare.NotificationPolicy` instead.* * * @deprecated Use `cloudflare_notification_policy` instead. */ notificationEmailAddresses?: pulumi.Input[]>; /** * Whether the notifications are suspended or not. Useful for maintenance periods. Valid values: `true` or `false` (Default: `false`). *Deprecated, use `cloudflare.NotificationPolicy` instead.* * * @deprecated Use `cloudflare_notification_policy` instead. */ notificationSuspended?: pulumi.Input; /** * The endpoint path to health check against. (Default: `/`) */ path?: pulumi.Input; /** * Port number to connect to for the health check. Valid values are in the range `0-65535` (Default: `80`). */ port?: 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; /** * If suspended, no health checks are sent to the origin. Valid values: `true` or `false` (Default: `false`). */ suspended?: pulumi.Input; /** * The timeout (in seconds) before marking the health check as failed. (Default: `5`) */ timeout?: pulumi.Input; /** * The protocol to use for the health check. Valid values: `HTTP`, `HTTPS`, `TCP`. */ type?: pulumi.Input; /** * The DNS zone ID to which apply settings. */ zoneId?: pulumi.Input; } /** * The set of arguments for constructing a Healthcheck resource. */ export interface HealthcheckArgs { /** * The hostname or IP address of the origin server to run health checks on. */ address: pulumi.Input; /** * Do not validate the certificate when the health check uses HTTPS. Valid values: `true` or `false` (Default: `false`). */ allowInsecure?: pulumi.Input; /** * A list of regions from which to run health checks. If not set Cloudflare will pick a default region. Valid values: `WNAM`, `ENAM`, `WEU`, `EEU`, `NSAM`, `SSAM`, `OC`, `ME`, `NAF`, `SAF`, `IN`, `SEAS`, `NEAS`, `ALL_REGIONS`. */ checkRegions?: pulumi.Input[]>; /** * The number of consecutive fails required from a health check before changing the health to unhealthy. (Default: `1`) */ consecutiveFails?: pulumi.Input; /** * The number of consecutive successes required from a health check before changing the health to healthy. (Default: `1`) */ consecutiveSuccesses?: pulumi.Input; /** * A human-readable description of the health check. */ 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. */ expectedBody?: pulumi.Input; /** * The expected HTTP response codes (e.g. "200") or code ranges (e.g. "2xx" for all codes starting with 2) of the health check. (Default: `["200"]`) */ expectedCodes?: pulumi.Input[]>; /** * Follow redirects if the origin returns a 3xx status code. Valid values: `true` or `false` (Default: `false`). */ followRedirects?: pulumi.Input; /** * The header name. */ headers?: pulumi.Input[]>; /** * The interval between each health check. Shorter intervals may give quicker notifications if the origin status changes, but will increase load on the origin as we check from multiple locations. (Default: `60`) */ interval?: pulumi.Input; /** * The TCP connection method to use for the health check. Valid values: `connectionEstablished` (Default: `connectionEstablished`). */ method?: pulumi.Input; /** * A short name to identify the health check. Only alphanumeric characters, hyphens and underscores are allowed. */ name: pulumi.Input; /** * A list of email addresses we want to send the notifications to. *Deprecated, use `cloudflare.NotificationPolicy` instead.* * * @deprecated Use `cloudflare_notification_policy` instead. */ notificationEmailAddresses?: pulumi.Input[]>; /** * Whether the notifications are suspended or not. Useful for maintenance periods. Valid values: `true` or `false` (Default: `false`). *Deprecated, use `cloudflare.NotificationPolicy` instead.* * * @deprecated Use `cloudflare_notification_policy` instead. */ notificationSuspended?: pulumi.Input; /** * The endpoint path to health check against. (Default: `/`) */ path?: pulumi.Input; /** * Port number to connect to for the health check. Valid values are in the range `0-65535` (Default: `80`). */ port?: 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; /** * If suspended, no health checks are sent to the origin. Valid values: `true` or `false` (Default: `false`). */ suspended?: pulumi.Input; /** * The timeout (in seconds) before marking the health check as failed. (Default: `5`) */ timeout?: pulumi.Input; /** * The protocol to use for the health check. Valid values: `HTTP`, `HTTPS`, `TCP`. */ type: pulumi.Input; /** * The DNS zone ID to which apply settings. */ zoneId: pulumi.Input; }