UNPKG

@huaweicloudos/pulumi

Version:

A Pulumi package for creating and managing Huaweicloud cloud resources.

107 lines 4.93 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.Pool = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages an ELB pool resource within HuaweiCloud. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as huaweicloud from "@pulumi/huaweicloud"; * * const pool1 = new huaweicloud.Elb.Pool("pool_1", { * lbMethod: "ROUND_ROBIN", * listenerId: "d9415786-5f1a-428b-b35f-2f1523e146d2", * persistences: [{ * cookieName: "testCookie", * type: "HTTP_COOKIE", * }], * protocol: "HTTP", * }); * ``` * * ## Import * * ELB pool can be imported using the pool ID, e.g. bash * * ```sh * $ pulumi import huaweicloud:Elb/pool:Pool pool_1 5c20fdad-7288-11eb-b817-0255ac10158b * ``` */ class Pool extends pulumi.CustomResource { /** * Get an existing Pool 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 Pool(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of Pool. 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'] === Pool.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["adminStateUp"] = state ? state.adminStateUp : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["lbMethod"] = state ? state.lbMethod : undefined; resourceInputs["listenerId"] = state ? state.listenerId : undefined; resourceInputs["loadbalancerId"] = state ? state.loadbalancerId : undefined; resourceInputs["monitorId"] = state ? state.monitorId : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["persistences"] = state ? state.persistences : undefined; resourceInputs["protectionReason"] = state ? state.protectionReason : undefined; resourceInputs["protectionStatus"] = state ? state.protectionStatus : undefined; resourceInputs["protocol"] = state ? state.protocol : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["tenantId"] = state ? state.tenantId : undefined; } else { const args = argsOrState; if ((!args || args.lbMethod === undefined) && !opts.urn) { throw new Error("Missing required property 'lbMethod'"); } if ((!args || args.protocol === undefined) && !opts.urn) { throw new Error("Missing required property 'protocol'"); } resourceInputs["adminStateUp"] = args ? args.adminStateUp : undefined; resourceInputs["description"] = args ? args.description : undefined; resourceInputs["lbMethod"] = args ? args.lbMethod : undefined; resourceInputs["listenerId"] = args ? args.listenerId : undefined; resourceInputs["loadbalancerId"] = args ? args.loadbalancerId : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["persistences"] = args ? args.persistences : undefined; resourceInputs["protectionReason"] = args ? args.protectionReason : undefined; resourceInputs["protectionStatus"] = args ? args.protectionStatus : undefined; resourceInputs["protocol"] = args ? args.protocol : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["tenantId"] = args ? args.tenantId : undefined; resourceInputs["monitorId"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Pool.__pulumiType, name, resourceInputs, opts); } } exports.Pool = Pool; /** @internal */ Pool.__pulumiType = 'huaweicloud:Elb/pool:Pool'; //# sourceMappingURL=pool.js.map