UNPKG

@pulumi/gcp

Version:

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

144 lines 6.44 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.HttpHealthCheck = void 0; const pulumi = __importStar(require("@pulumi/pulumi")); const utilities = __importStar(require("../utilities")); /** * An HttpHealthCheck resource. This resource defines a template for how * individual VMs should be checked for health, via HTTP. * * > **Note:** gcp.compute.HttpHealthCheck is a legacy health check. * The newer [gcp.compute.HealthCheck](https://www.terraform.io/docs/providers/google/r/compute_health_check.html) * should be preferred for all uses except * [Network Load Balancers](https://cloud.google.com/compute/docs/load-balancing/network/) * which still require the legacy version. * * To get more information about HttpHealthCheck, see: * * * [API documentation](https://cloud.google.com/compute/docs/reference/v1/httpHealthChecks) * * How-to Guides * * [Adding Health Checks](https://cloud.google.com/compute/docs/load-balancing/health-checks#legacy_health_checks) * * ## Example Usage * * ### Http Health Check Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const _default = new gcp.compute.HttpHealthCheck("default", { * name: "authentication-health-check", * requestPath: "/health_check", * timeoutSec: 1, * checkIntervalSec: 1, * }); * ``` * * ## Import * * HttpHealthCheck can be imported using any of these accepted formats: * * * `projects/{{project}}/global/httpHealthChecks/{{name}}` * * `{{project}}/{{name}}` * * `{{name}}` * * When using the `pulumi import` command, HttpHealthCheck can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:compute/httpHealthCheck:HttpHealthCheck default projects/{{project}}/global/httpHealthChecks/{{name}} * $ pulumi import gcp:compute/httpHealthCheck:HttpHealthCheck default {{project}}/{{name}} * $ pulumi import gcp:compute/httpHealthCheck:HttpHealthCheck default {{name}} * ``` */ class HttpHealthCheck extends pulumi.CustomResource { /** * Get an existing HttpHealthCheck 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 HttpHealthCheck(name, state, { ...opts, id: id }); } /** @internal */ static __pulumiType = 'gcp:compute/httpHealthCheck:HttpHealthCheck'; /** * Returns true if the given object is an instance of HttpHealthCheck. 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'] === HttpHealthCheck.__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["healthyThreshold"] = state?.healthyThreshold; resourceInputs["host"] = state?.host; resourceInputs["name"] = state?.name; resourceInputs["port"] = state?.port; resourceInputs["project"] = state?.project; resourceInputs["requestPath"] = state?.requestPath; resourceInputs["selfLink"] = state?.selfLink; resourceInputs["timeoutSec"] = state?.timeoutSec; resourceInputs["unhealthyThreshold"] = state?.unhealthyThreshold; } else { const args = argsOrState; resourceInputs["checkIntervalSec"] = args?.checkIntervalSec; resourceInputs["deletionPolicy"] = args?.deletionPolicy; resourceInputs["description"] = args?.description; resourceInputs["healthyThreshold"] = args?.healthyThreshold; resourceInputs["host"] = args?.host; resourceInputs["name"] = args?.name; resourceInputs["port"] = args?.port; resourceInputs["project"] = args?.project; resourceInputs["requestPath"] = args?.requestPath; resourceInputs["timeoutSec"] = args?.timeoutSec; resourceInputs["unhealthyThreshold"] = args?.unhealthyThreshold; resourceInputs["creationTimestamp"] = undefined /*out*/; resourceInputs["selfLink"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(HttpHealthCheck.__pulumiType, name, resourceInputs, opts); } } exports.HttpHealthCheck = HttpHealthCheck; //# sourceMappingURL=httpHealthCheck.js.map