UNPKG

@huaweicloudos/pulumi

Version:

A Pulumi package for creating and managing Huaweicloud cloud resources.

109 lines 5.01 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.Member = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages an ELB member resource within HuaweiCloud. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as pulumi from "@huaweicloudos/pulumi"; * * const config = new pulumi.Config(); * const lbPoolId = config.requireObject("lbPoolId"); * const ipv4SubnetId = config.requireObject("ipv4SubnetId"); * const member1 = new huaweicloud.elb.Member("member1", { * address: "192.168.199.23", * protocolPort: 8080, * poolId: lbPoolId, * subnetId: ipv4SubnetId, * }); * ``` * * ## Import * * ELB member can be imported using the pool ID and member ID separated by a slash, e.g. bash * * ```sh * $ pulumi import huaweicloud:Elb/member:Member member_1 e0bd694a-abbe-450e-b329-0931fd1cc5eb/4086b0c9-b18c-4d1c-b6b8-4c56c3ad2a9e * ``` */ class Member extends pulumi.CustomResource { /** * Get an existing Member 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 Member(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of Member. 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'] === Member.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["address"] = state ? state.address : undefined; resourceInputs["adminStateUp"] = state ? state.adminStateUp : undefined; resourceInputs["backendServerStatus"] = state ? state.backendServerStatus : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["operatingStatus"] = state ? state.operatingStatus : undefined; resourceInputs["poolId"] = state ? state.poolId : undefined; resourceInputs["protocolPort"] = state ? state.protocolPort : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["subnetId"] = state ? state.subnetId : undefined; resourceInputs["tenantId"] = state ? state.tenantId : undefined; resourceInputs["weight"] = state ? state.weight : undefined; } else { const args = argsOrState; if ((!args || args.address === undefined) && !opts.urn) { throw new Error("Missing required property 'address'"); } if ((!args || args.poolId === undefined) && !opts.urn) { throw new Error("Missing required property 'poolId'"); } if ((!args || args.protocolPort === undefined) && !opts.urn) { throw new Error("Missing required property 'protocolPort'"); } if ((!args || args.subnetId === undefined) && !opts.urn) { throw new Error("Missing required property 'subnetId'"); } resourceInputs["address"] = args ? args.address : undefined; resourceInputs["adminStateUp"] = args ? args.adminStateUp : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["poolId"] = args ? args.poolId : undefined; resourceInputs["protocolPort"] = args ? args.protocolPort : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["subnetId"] = args ? args.subnetId : undefined; resourceInputs["tenantId"] = args ? args.tenantId : undefined; resourceInputs["weight"] = args ? args.weight : undefined; resourceInputs["backendServerStatus"] = undefined /*out*/; resourceInputs["operatingStatus"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Member.__pulumiType, name, resourceInputs, opts); } } exports.Member = Member; /** @internal */ Member.__pulumiType = 'huaweicloud:Elb/member:Member'; //# sourceMappingURL=member.js.map