@huaweicloudos/pulumi
Version:
A Pulumi package for creating and managing Huaweicloud cloud resources.
126 lines • 5.88 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.Monitor = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages an ELB monitor resource within HuaweiCloud.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const config = new pulumi.Config();
* const poolId = config.requireObject("poolId");
* const monitor1 = new huaweicloud.dedicatedelb.Monitor("monitor1", {
* poolId: poolId,
* protocol: "HTTPS",
* interval: 30,
* timeout: 20,
* maxRetries: 8,
* urlPath: "/bb",
* domainName: "www.bb.com",
* port: 8888,
* statusCode: "200,301,404-500,504",
* });
* ```
*
* ## Import
*
* ELB monitor can be imported using the monitor `id`, e.g. bash
*
* ```sh
* $ pulumi import huaweicloud:DedicatedElb/monitor:Monitor test <id>
* ```
*/
class Monitor extends pulumi.CustomResource {
/**
* Get an existing Monitor 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 Monitor(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of Monitor. 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'] === Monitor.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["createdAt"] = state ? state.createdAt : undefined;
resourceInputs["domainName"] = state ? state.domainName : undefined;
resourceInputs["enabled"] = state ? state.enabled : undefined;
resourceInputs["httpMethod"] = state ? state.httpMethod : undefined;
resourceInputs["interval"] = state ? state.interval : undefined;
resourceInputs["maxRetries"] = state ? state.maxRetries : undefined;
resourceInputs["maxRetriesDown"] = state ? state.maxRetriesDown : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["poolId"] = state ? state.poolId : undefined;
resourceInputs["port"] = state ? state.port : undefined;
resourceInputs["protocol"] = state ? state.protocol : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["statusCode"] = state ? state.statusCode : undefined;
resourceInputs["timeout"] = state ? state.timeout : undefined;
resourceInputs["updatedAt"] = state ? state.updatedAt : undefined;
resourceInputs["urlPath"] = state ? state.urlPath : undefined;
}
else {
const args = argsOrState;
if ((!args || args.interval === undefined) && !opts.urn) {
throw new Error("Missing required property 'interval'");
}
if ((!args || args.maxRetries === undefined) && !opts.urn) {
throw new Error("Missing required property 'maxRetries'");
}
if ((!args || args.poolId === undefined) && !opts.urn) {
throw new Error("Missing required property 'poolId'");
}
if ((!args || args.protocol === undefined) && !opts.urn) {
throw new Error("Missing required property 'protocol'");
}
if ((!args || args.timeout === undefined) && !opts.urn) {
throw new Error("Missing required property 'timeout'");
}
resourceInputs["domainName"] = args ? args.domainName : undefined;
resourceInputs["enabled"] = args ? args.enabled : undefined;
resourceInputs["httpMethod"] = args ? args.httpMethod : undefined;
resourceInputs["interval"] = args ? args.interval : undefined;
resourceInputs["maxRetries"] = args ? args.maxRetries : undefined;
resourceInputs["maxRetriesDown"] = args ? args.maxRetriesDown : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["poolId"] = args ? args.poolId : undefined;
resourceInputs["port"] = args ? args.port : undefined;
resourceInputs["protocol"] = args ? args.protocol : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["statusCode"] = args ? args.statusCode : undefined;
resourceInputs["timeout"] = args ? args.timeout : undefined;
resourceInputs["urlPath"] = args ? args.urlPath : undefined;
resourceInputs["createdAt"] = undefined /*out*/;
resourceInputs["updatedAt"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Monitor.__pulumiType, name, resourceInputs, opts);
}
}
exports.Monitor = Monitor;
/** @internal */
Monitor.__pulumiType = 'huaweicloud:DedicatedElb/monitor:Monitor';
//# sourceMappingURL=monitor.js.map