@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
127 lines • 5.78 kB
JavaScript
;
// *** 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.HttpsHealthCheck = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* An HttpsHealthCheck resource. This resource defines a template for how
* individual VMs should be checked for health, via HTTPS.
*
* > **Note:** gcp.compute.HttpsHealthCheck 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 HttpsHealthCheck, see:
*
* * [API documentation](https://cloud.google.com/compute/docs/reference/v1/httpsHealthChecks)
* * How-to Guides
* * [Adding Health Checks](https://cloud.google.com/compute/docs/load-balancing/health-checks#legacy_health_checks)
*
* ## Example Usage
*
* ### Https Health Check Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const _default = new gcp.compute.HttpsHealthCheck("default", {
* name: "authentication-health-check",
* requestPath: "/health_check",
* timeoutSec: 1,
* checkIntervalSec: 1,
* });
* ```
*
* ## Import
*
* HttpsHealthCheck can be imported using any of these accepted formats:
*
* * `projects/{{project}}/global/httpsHealthChecks/{{name}}`
*
* * `{{project}}/{{name}}`
*
* * `{{name}}`
*
* When using the `pulumi import` command, HttpsHealthCheck can be imported using one of the formats above. For example:
*
* ```sh
* $ pulumi import gcp:compute/httpsHealthCheck:HttpsHealthCheck default projects/{{project}}/global/httpsHealthChecks/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:compute/httpsHealthCheck:HttpsHealthCheck default {{project}}/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:compute/httpsHealthCheck:HttpsHealthCheck default {{name}}
* ```
*/
class HttpsHealthCheck extends pulumi.CustomResource {
/**
* Get an existing HttpsHealthCheck 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 HttpsHealthCheck(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of HttpsHealthCheck. 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'] === HttpsHealthCheck.__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["healthyThreshold"] = state ? state.healthyThreshold : undefined;
resourceInputs["host"] = state ? state.host : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["port"] = state ? state.port : undefined;
resourceInputs["project"] = state ? state.project : undefined;
resourceInputs["requestPath"] = state ? state.requestPath : undefined;
resourceInputs["selfLink"] = state ? state.selfLink : undefined;
resourceInputs["timeoutSec"] = state ? state.timeoutSec : undefined;
resourceInputs["unhealthyThreshold"] = state ? state.unhealthyThreshold : undefined;
}
else {
const args = argsOrState;
resourceInputs["checkIntervalSec"] = args ? args.checkIntervalSec : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["healthyThreshold"] = args ? args.healthyThreshold : undefined;
resourceInputs["host"] = args ? args.host : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["port"] = args ? args.port : undefined;
resourceInputs["project"] = args ? args.project : undefined;
resourceInputs["requestPath"] = args ? args.requestPath : undefined;
resourceInputs["timeoutSec"] = args ? args.timeoutSec : undefined;
resourceInputs["unhealthyThreshold"] = args ? args.unhealthyThreshold : undefined;
resourceInputs["creationTimestamp"] = undefined /*out*/;
resourceInputs["selfLink"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(HttpsHealthCheck.__pulumiType, name, resourceInputs, opts);
}
}
exports.HttpsHealthCheck = HttpsHealthCheck;
/** @internal */
HttpsHealthCheck.__pulumiType = 'gcp:compute/httpsHealthCheck:HttpsHealthCheck';
//# sourceMappingURL=httpsHealthCheck.js.map