UNPKG

@pulumi/gcp

Version:

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

375 lines • 13.9 kB
"use strict"; // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.RegionHealthCheck = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = 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", * }, * }); * ``` * * ## 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}} * ``` * * ```sh * $ pulumi import gcp:compute/regionHealthCheck:RegionHealthCheck default {{project}}/{{region}}/{{name}} * ``` * * ```sh * $ pulumi import gcp:compute/regionHealthCheck:RegionHealthCheck default {{region}}/{{name}} * ``` * * ```sh * $ 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, Object.assign(Object.assign({}, opts), { id: id })); } /** * 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 ? state.checkIntervalSec : undefined; resourceInputs["creationTimestamp"] = state ? state.creationTimestamp : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["grpcHealthCheck"] = state ? state.grpcHealthCheck : undefined; resourceInputs["healthCheckId"] = state ? state.healthCheckId : undefined; resourceInputs["healthyThreshold"] = state ? state.healthyThreshold : undefined; resourceInputs["http2HealthCheck"] = state ? state.http2HealthCheck : undefined; resourceInputs["httpHealthCheck"] = state ? state.httpHealthCheck : undefined; resourceInputs["httpsHealthCheck"] = state ? state.httpsHealthCheck : undefined; resourceInputs["logConfig"] = state ? state.logConfig : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["project"] = state ? state.project : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["selfLink"] = state ? state.selfLink : undefined; resourceInputs["sslHealthCheck"] = state ? state.sslHealthCheck : undefined; resourceInputs["tcpHealthCheck"] = state ? state.tcpHealthCheck : undefined; resourceInputs["timeoutSec"] = state ? state.timeoutSec : undefined; resourceInputs["type"] = state ? state.type : undefined; resourceInputs["unhealthyThreshold"] = state ? state.unhealthyThreshold : undefined; } else { const args = argsOrState; resourceInputs["checkIntervalSec"] = args ? args.checkIntervalSec : undefined; resourceInputs["description"] = args ? args.description : undefined; resourceInputs["grpcHealthCheck"] = args ? args.grpcHealthCheck : undefined; resourceInputs["healthyThreshold"] = args ? args.healthyThreshold : undefined; resourceInputs["http2HealthCheck"] = args ? args.http2HealthCheck : undefined; resourceInputs["httpHealthCheck"] = args ? args.httpHealthCheck : undefined; resourceInputs["httpsHealthCheck"] = args ? args.httpsHealthCheck : undefined; resourceInputs["logConfig"] = args ? args.logConfig : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["project"] = args ? args.project : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["sslHealthCheck"] = args ? args.sslHealthCheck : undefined; resourceInputs["tcpHealthCheck"] = args ? args.tcpHealthCheck : undefined; resourceInputs["timeoutSec"] = args ? args.timeoutSec : undefined; resourceInputs["unhealthyThreshold"] = args ? args.unhealthyThreshold : undefined; 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; /** @internal */ RegionHealthCheck.__pulumiType = 'gcp:compute/regionHealthCheck:RegionHealthCheck'; //# sourceMappingURL=regionHealthCheck.js.map