UNPKG

@huaweicloudos/pulumi

Version:

A Pulumi package for creating and managing Huaweicloud cloud resources.

147 lines 6.12 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.Monitor = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages an ELB monitor resource within HuaweiCloud. * * ## Example Usage * ### TCP Health Check * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as pulumi from "@huaweicloudos/pulumi"; * * const monitorTcp = new huaweicloud.elb.Monitor("monitorTcp", { * poolId: _var.pool_id, * type: "TCP", * delay: 5, * timeout: 3, * maxRetries: 3, * }); * ``` * ### UDP Health Check * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as pulumi from "@huaweicloudos/pulumi"; * * const monitorUdp = new huaweicloud.elb.Monitor("monitorUdp", { * poolId: _var.pool_id, * type: "UDP_CONNECT", * delay: 5, * timeout: 3, * maxRetries: 3, * }); * ``` * ### HTTP Health Check * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as pulumi from "@huaweicloudos/pulumi"; * * const monitorHttp = new huaweicloud.elb.Monitor("monitorHttp", { * poolId: _var.pool_id, * type: "HTTP", * delay: 5, * timeout: 3, * maxRetries: 3, * urlPath: "/test", * expectedCodes: "200-202", * }); * ``` * * ## Import * * ELB monitor can be imported using the monitor ID, e.g. bash * * ```sh * $ pulumi import huaweicloud:Elb/monitor:Monitor monitor_1 5c20fdad-7288-11eb-b817-0255ac10158b * ``` */ 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["adminStateUp"] = state ? state.adminStateUp : undefined; resourceInputs["delay"] = state ? state.delay : undefined; resourceInputs["domainName"] = state ? state.domainName : undefined; resourceInputs["expectedCodes"] = state ? state.expectedCodes : undefined; resourceInputs["httpMethod"] = state ? state.httpMethod : undefined; resourceInputs["maxRetries"] = state ? state.maxRetries : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["poolId"] = state ? state.poolId : undefined; resourceInputs["port"] = state ? state.port : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["tenantId"] = state ? state.tenantId : undefined; resourceInputs["timeout"] = state ? state.timeout : undefined; resourceInputs["type"] = state ? state.type : undefined; resourceInputs["urlPath"] = state ? state.urlPath : undefined; } else { const args = argsOrState; if ((!args || args.delay === undefined) && !opts.urn) { throw new Error("Missing required property 'delay'"); } 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.timeout === undefined) && !opts.urn) { throw new Error("Missing required property 'timeout'"); } if ((!args || args.type === undefined) && !opts.urn) { throw new Error("Missing required property 'type'"); } resourceInputs["adminStateUp"] = args ? args.adminStateUp : undefined; resourceInputs["delay"] = args ? args.delay : undefined; resourceInputs["domainName"] = args ? args.domainName : undefined; resourceInputs["expectedCodes"] = args ? args.expectedCodes : undefined; resourceInputs["httpMethod"] = args ? args.httpMethod : undefined; resourceInputs["maxRetries"] = args ? args.maxRetries : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["poolId"] = args ? args.poolId : undefined; resourceInputs["port"] = args ? args.port : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["tenantId"] = args ? args.tenantId : undefined; resourceInputs["timeout"] = args ? args.timeout : undefined; resourceInputs["type"] = args ? args.type : undefined; resourceInputs["urlPath"] = args ? args.urlPath : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Monitor.__pulumiType, name, resourceInputs, opts); } } exports.Monitor = Monitor; /** @internal */ Monitor.__pulumiType = 'huaweicloud:Elb/monitor:Monitor'; //# sourceMappingURL=monitor.js.map