@huaweicloudos/pulumi
Version:
A Pulumi package for creating and managing Huaweicloud cloud resources.
141 lines • 6.65 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.ActiveStandbyPool = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages an ELB active-standby pool resource within HuaweiCloud.
*
* ## Example Usage
* ### Create an active-standby Pool
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const config = new pulumi.Config();
* const vpcId = config.requireObject("vpcId");
* const test = new huaweicloud.dedicatedelb.ActiveStandbyPool("test", {
* description: "test description",
* protocol: "TCP",
* vpcId: vpcId,
* type: "instance",
* anyPortEnable: false,
* members: [
* {
* address: "192.168.0.1",
* role: "master",
* protocolPort: 45,
* },
* {
* address: "192.168.0.2",
* role: "slave",
* protocolPort: 36,
* },
* ],
* healthmonitor: {
* delay: 5,
* expectedCodes: "200",
* maxRetries: 3,
* maxRetriesDown: 3,
* timeout: 3,
* type: "TCP",
* },
* });
* ```
*
* ## Import
*
* ELB active-standby pool can be imported using the `id`, e.g. bash
*
* ```sh
* $ pulumi import huaweicloud:DedicatedElb/activeStandbyPool:ActiveStandbyPool test <id>
* ```
*/
class ActiveStandbyPool extends pulumi.CustomResource {
/**
* Get an existing ActiveStandbyPool 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 ActiveStandbyPool(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of ActiveStandbyPool. 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'] === ActiveStandbyPool.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["anyPortEnable"] = state ? state.anyPortEnable : undefined;
resourceInputs["connectionDrainEnabled"] = state ? state.connectionDrainEnabled : undefined;
resourceInputs["connectionDrainTimeout"] = state ? state.connectionDrainTimeout : undefined;
resourceInputs["createdAt"] = state ? state.createdAt : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["healthmonitor"] = state ? state.healthmonitor : undefined;
resourceInputs["ipVersion"] = state ? state.ipVersion : undefined;
resourceInputs["lbAlgorithm"] = state ? state.lbAlgorithm : undefined;
resourceInputs["listenerId"] = state ? state.listenerId : undefined;
resourceInputs["loadbalancerId"] = state ? state.loadbalancerId : undefined;
resourceInputs["members"] = state ? state.members : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["protocol"] = state ? state.protocol : undefined;
resourceInputs["quicCidHashStrategies"] = state ? state.quicCidHashStrategies : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["type"] = state ? state.type : undefined;
resourceInputs["updatedAt"] = state ? state.updatedAt : undefined;
resourceInputs["vpcId"] = state ? state.vpcId : undefined;
}
else {
const args = argsOrState;
if ((!args || args.healthmonitor === undefined) && !opts.urn) {
throw new Error("Missing required property 'healthmonitor'");
}
if ((!args || args.members === undefined) && !opts.urn) {
throw new Error("Missing required property 'members'");
}
if ((!args || args.protocol === undefined) && !opts.urn) {
throw new Error("Missing required property 'protocol'");
}
resourceInputs["anyPortEnable"] = args ? args.anyPortEnable : undefined;
resourceInputs["connectionDrainEnabled"] = args ? args.connectionDrainEnabled : undefined;
resourceInputs["connectionDrainTimeout"] = args ? args.connectionDrainTimeout : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["healthmonitor"] = args ? args.healthmonitor : undefined;
resourceInputs["ipVersion"] = args ? args.ipVersion : undefined;
resourceInputs["lbAlgorithm"] = args ? args.lbAlgorithm : undefined;
resourceInputs["listenerId"] = args ? args.listenerId : undefined;
resourceInputs["loadbalancerId"] = args ? args.loadbalancerId : undefined;
resourceInputs["members"] = args ? args.members : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["protocol"] = args ? args.protocol : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["type"] = args ? args.type : undefined;
resourceInputs["vpcId"] = args ? args.vpcId : undefined;
resourceInputs["createdAt"] = undefined /*out*/;
resourceInputs["quicCidHashStrategies"] = undefined /*out*/;
resourceInputs["updatedAt"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(ActiveStandbyPool.__pulumiType, name, resourceInputs, opts);
}
}
exports.ActiveStandbyPool = ActiveStandbyPool;
/** @internal */
ActiveStandbyPool.__pulumiType = 'huaweicloud:DedicatedElb/activeStandbyPool:ActiveStandbyPool';
//# sourceMappingURL=activeStandbyPool.js.map