UNPKG

@pulumi/gcp

Version:

A Pulumi package for creating and managing Google Cloud Platform resources.

425 lines • 15.6 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.RegionHealthCheck = void 0; const pulumi = __importStar(require("@pulumi/pulumi")); const utilities = __importStar(require("../utilities")); /** * Health Checks determine whether instances are responsive and able to do work. * They are an important part of a comprehensive load balancing configuration, * as they enable monitoring instances behind load balancers. * * Health Checks poll instances at a specified interval. Instances that * do not respond successfully to some number of probes in a row are marked * as unhealthy. No new connections are sent to unhealthy instances, * though existing connections will continue. The health check will * continue to poll unhealthy instances. If an instance later responds * successfully to some number of consecutive probes, it is marked * healthy again and can receive new connections. * * To get more information about RegionHealthCheck, see: * * * [API documentation](https://cloud.google.com/compute/docs/reference/rest/v1/regionHealthChecks) * * How-to Guides * * [Official Documentation](https://cloud.google.com/load-balancing/docs/health-checks) * * ## Example Usage * * ### Region Health Check Tcp * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const tcp_region_health_check = new gcp.compute.RegionHealthCheck("tcp-region-health-check", { * name: "tcp-region-health-check", * timeoutSec: 1, * checkIntervalSec: 1, * tcpHealthCheck: { * port: 80, * }, * }); * ``` * ### Region Health Check Tcp Full * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const tcp_region_health_check = new gcp.compute.RegionHealthCheck("tcp-region-health-check", { * name: "tcp-region-health-check", * description: "Health check via tcp", * timeoutSec: 1, * checkIntervalSec: 1, * healthyThreshold: 4, * unhealthyThreshold: 5, * tcpHealthCheck: { * portName: "health-check-port", * portSpecification: "USE_NAMED_PORT", * request: "ARE YOU HEALTHY?", * proxyHeader: "NONE", * response: "I AM HEALTHY", * }, * }); * ``` * ### Region Health Check Ssl * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const ssl_region_health_check = new gcp.compute.RegionHealthCheck("ssl-region-health-check", { * name: "ssl-region-health-check", * timeoutSec: 1, * checkIntervalSec: 1, * sslHealthCheck: { * port: 443, * }, * }); * ``` * ### Region Health Check Ssl Full * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const ssl_region_health_check = new gcp.compute.RegionHealthCheck("ssl-region-health-check", { * name: "ssl-region-health-check", * description: "Health check via ssl", * timeoutSec: 1, * checkIntervalSec: 1, * healthyThreshold: 4, * unhealthyThreshold: 5, * sslHealthCheck: { * portName: "health-check-port", * portSpecification: "USE_NAMED_PORT", * request: "ARE YOU HEALTHY?", * proxyHeader: "NONE", * response: "I AM HEALTHY", * }, * }); * ``` * ### Region Health Check Http * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const http_region_health_check = new gcp.compute.RegionHealthCheck("http-region-health-check", { * name: "http-region-health-check", * timeoutSec: 1, * checkIntervalSec: 1, * httpHealthCheck: { * port: 80, * }, * }); * ``` * ### Region Health Check Http Logs * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const http_region_health_check = new gcp.compute.RegionHealthCheck("http-region-health-check", { * name: "http-region-health-check", * timeoutSec: 1, * checkIntervalSec: 1, * httpHealthCheck: { * port: 80, * }, * logConfig: { * enable: true, * }, * }); * ``` * ### Region Health Check Http Full * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const http_region_health_check = new gcp.compute.RegionHealthCheck("http-region-health-check", { * name: "http-region-health-check", * description: "Health check via http", * timeoutSec: 1, * checkIntervalSec: 1, * healthyThreshold: 4, * unhealthyThreshold: 5, * httpHealthCheck: { * portName: "health-check-port", * portSpecification: "USE_NAMED_PORT", * host: "1.2.3.4", * requestPath: "/mypath", * proxyHeader: "NONE", * response: "I AM HEALTHY", * }, * }); * ``` * ### Region Health Check Https * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const https_region_health_check = new gcp.compute.RegionHealthCheck("https-region-health-check", { * name: "https-region-health-check", * timeoutSec: 1, * checkIntervalSec: 1, * httpsHealthCheck: { * port: 443, * }, * }); * ``` * ### Region Health Check Https Full * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const https_region_health_check = new gcp.compute.RegionHealthCheck("https-region-health-check", { * name: "https-region-health-check", * description: "Health check via https", * timeoutSec: 1, * checkIntervalSec: 1, * healthyThreshold: 4, * unhealthyThreshold: 5, * httpsHealthCheck: { * portName: "health-check-port", * portSpecification: "USE_NAMED_PORT", * host: "1.2.3.4", * requestPath: "/mypath", * proxyHeader: "NONE", * response: "I AM HEALTHY", * }, * }); * ``` * ### Region Health Check Http2 * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const http2_region_health_check = new gcp.compute.RegionHealthCheck("http2-region-health-check", { * name: "http2-region-health-check", * timeoutSec: 1, * checkIntervalSec: 1, * http2HealthCheck: { * port: 443, * }, * }); * ``` * ### Region Health Check Http2 Full * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const http2_region_health_check = new gcp.compute.RegionHealthCheck("http2-region-health-check", { * name: "http2-region-health-check", * description: "Health check via http2", * timeoutSec: 1, * checkIntervalSec: 1, * healthyThreshold: 4, * unhealthyThreshold: 5, * http2HealthCheck: { * portName: "health-check-port", * portSpecification: "USE_NAMED_PORT", * host: "1.2.3.4", * requestPath: "/mypath", * proxyHeader: "NONE", * response: "I AM HEALTHY", * }, * }); * ``` * ### Region Health Check Grpc * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const grpc_region_health_check = new gcp.compute.RegionHealthCheck("grpc-region-health-check", { * name: "grpc-region-health-check", * timeoutSec: 1, * checkIntervalSec: 1, * grpcHealthCheck: { * port: 443, * }, * }); * ``` * ### Region Health Check Grpc Full * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const grpc_region_health_check = new gcp.compute.RegionHealthCheck("grpc-region-health-check", { * name: "grpc-region-health-check", * timeoutSec: 1, * checkIntervalSec: 1, * grpcHealthCheck: { * portName: "health-check-port", * portSpecification: "USE_NAMED_PORT", * grpcServiceName: "testservice", * }, * }); * ``` * ### Region Health Check Grpc With Tls * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const grpc_with_tls_region_health_check = new gcp.compute.RegionHealthCheck("grpc-with-tls-region-health-check", { * name: "grpc-with-tls-region-health-check", * timeoutSec: 1, * checkIntervalSec: 1, * grpcTlsHealthCheck: { * port: 443, * }, * }); * ``` * ### Region Health Check Grpc With Tls Full * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const grpc_with_tls_region_health_check = new gcp.compute.RegionHealthCheck("grpc-with-tls-region-health-check", { * name: "grpc-with-tls-region-health-check", * description: "regional health check via GRPC with TLS", * timeoutSec: 1, * checkIntervalSec: 1, * healthyThreshold: 4, * unhealthyThreshold: 5, * grpcTlsHealthCheck: { * portSpecification: "USE_FIXED_PORT", * port: 443, * grpcServiceName: "testservice", * }, * }); * ``` * * ## Import * * RegionHealthCheck can be imported using any of these accepted formats: * * * `projects/{{project}}/regions/{{region}}/healthChecks/{{name}}` * * `{{project}}/{{region}}/{{name}}` * * `{{region}}/{{name}}` * * `{{name}}` * * When using the `pulumi import` command, RegionHealthCheck can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:compute/regionHealthCheck:RegionHealthCheck default projects/{{project}}/regions/{{region}}/healthChecks/{{name}} * $ pulumi import gcp:compute/regionHealthCheck:RegionHealthCheck default {{project}}/{{region}}/{{name}} * $ pulumi import gcp:compute/regionHealthCheck:RegionHealthCheck default {{region}}/{{name}} * $ pulumi import gcp:compute/regionHealthCheck:RegionHealthCheck default {{name}} * ``` */ class RegionHealthCheck extends pulumi.CustomResource { /** * Get an existing RegionHealthCheck 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, id, state, opts) { return new RegionHealthCheck(name, state, { ...opts, id: id }); } /** @internal */ static __pulumiType = 'gcp:compute/regionHealthCheck:RegionHealthCheck'; /** * Returns true if the given object is an instance of RegionHealthCheck. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj) { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === RegionHealthCheck.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["checkIntervalSec"] = state?.checkIntervalSec; resourceInputs["creationTimestamp"] = state?.creationTimestamp; resourceInputs["deletionPolicy"] = state?.deletionPolicy; resourceInputs["description"] = state?.description; resourceInputs["grpcHealthCheck"] = state?.grpcHealthCheck; resourceInputs["grpcTlsHealthCheck"] = state?.grpcTlsHealthCheck; resourceInputs["healthCheckId"] = state?.healthCheckId; resourceInputs["healthyThreshold"] = state?.healthyThreshold; resourceInputs["http2HealthCheck"] = state?.http2HealthCheck; resourceInputs["httpHealthCheck"] = state?.httpHealthCheck; resourceInputs["httpsHealthCheck"] = state?.httpsHealthCheck; resourceInputs["logConfig"] = state?.logConfig; resourceInputs["name"] = state?.name; resourceInputs["project"] = state?.project; resourceInputs["region"] = state?.region; resourceInputs["selfLink"] = state?.selfLink; resourceInputs["sslHealthCheck"] = state?.sslHealthCheck; resourceInputs["tcpHealthCheck"] = state?.tcpHealthCheck; resourceInputs["timeoutSec"] = state?.timeoutSec; resourceInputs["type"] = state?.type; resourceInputs["unhealthyThreshold"] = state?.unhealthyThreshold; } else { const args = argsOrState; resourceInputs["checkIntervalSec"] = args?.checkIntervalSec; resourceInputs["deletionPolicy"] = args?.deletionPolicy; resourceInputs["description"] = args?.description; resourceInputs["grpcHealthCheck"] = args?.grpcHealthCheck; resourceInputs["grpcTlsHealthCheck"] = args?.grpcTlsHealthCheck; resourceInputs["healthyThreshold"] = args?.healthyThreshold; resourceInputs["http2HealthCheck"] = args?.http2HealthCheck; resourceInputs["httpHealthCheck"] = args?.httpHealthCheck; resourceInputs["httpsHealthCheck"] = args?.httpsHealthCheck; resourceInputs["logConfig"] = args?.logConfig; resourceInputs["name"] = args?.name; resourceInputs["project"] = args?.project; resourceInputs["region"] = args?.region; resourceInputs["sslHealthCheck"] = args?.sslHealthCheck; resourceInputs["tcpHealthCheck"] = args?.tcpHealthCheck; resourceInputs["timeoutSec"] = args?.timeoutSec; resourceInputs["unhealthyThreshold"] = args?.unhealthyThreshold; resourceInputs["creationTimestamp"] = undefined /*out*/; resourceInputs["healthCheckId"] = undefined /*out*/; resourceInputs["selfLink"] = undefined /*out*/; resourceInputs["type"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(RegionHealthCheck.__pulumiType, name, resourceInputs, opts); } } exports.RegionHealthCheck = RegionHealthCheck; //# sourceMappingURL=regionHealthCheck.js.map