@huaweicloudos/pulumi
Version:
A Pulumi package for creating and managing Huaweicloud cloud resources.
161 lines • 8.34 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.MysqlProxy = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages RDS mysql proxy resource within HuaweiCloud.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const config = new pulumi.Config();
* const instanceId = config.requireObject("instanceId");
* const replicaNodeId1 = config.requireObject("replicaNodeId1");
* const replicaNodeId2 = config.requireObject("replicaNodeId2");
* const test = new huaweicloud.rds.MysqlProxy("test", {
* instanceId: instanceId,
* flavor: "rds.proxy.large.2",
* nodeNum: 3,
* routeMode: 0,
* masterNodeWeight: {
* id: instanceId,
* weight: 10,
* },
* readonlyNodesWeights: [
* {
* id: replicaNodeId1,
* weight: 20,
* },
* {
* id: replicaNodeId2,
* weight: 30,
* },
* ],
* });
* ```
*
* ## Import
*
* The RDS MySQL proxy can be imported using the `instance_id` and `id` separated by a slash, e.g. bash
*
* ```sh
* $ pulumi import huaweicloud:Rds/mysqlProxy:MysqlProxy test <instance_id>/<id>
* ```
*/
class MysqlProxy extends pulumi.CustomResource {
/**
* Get an existing MysqlProxy 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 MysqlProxy(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of MysqlProxy. 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'] === MysqlProxy.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["address"] = state ? state.address : undefined;
resourceInputs["altFlag"] = state ? state.altFlag : undefined;
resourceInputs["connectionPoolType"] = state ? state.connectionPoolType : undefined;
resourceInputs["delayThresholdInSeconds"] = state ? state.delayThresholdInSeconds : undefined;
resourceInputs["dnsName"] = state ? state.dnsName : undefined;
resourceInputs["flavor"] = state ? state.flavor : undefined;
resourceInputs["flavorGroupType"] = state ? state.flavorGroupType : undefined;
resourceInputs["forceReadOnly"] = state ? state.forceReadOnly : undefined;
resourceInputs["instanceId"] = state ? state.instanceId : undefined;
resourceInputs["masterNodeWeight"] = state ? state.masterNodeWeight : undefined;
resourceInputs["memory"] = state ? state.memory : undefined;
resourceInputs["mode"] = state ? state.mode : undefined;
resourceInputs["nodeNum"] = state ? state.nodeNum : undefined;
resourceInputs["nodes"] = state ? state.nodes : undefined;
resourceInputs["payMode"] = state ? state.payMode : undefined;
resourceInputs["port"] = state ? state.port : undefined;
resourceInputs["proxyMode"] = state ? state.proxyMode : undefined;
resourceInputs["proxyName"] = state ? state.proxyName : undefined;
resourceInputs["readonlyNodesWeights"] = state ? state.readonlyNodesWeights : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["routeMode"] = state ? state.routeMode : undefined;
resourceInputs["secondsLevelMonitorFunStatus"] = state ? state.secondsLevelMonitorFunStatus : undefined;
resourceInputs["sslOption"] = state ? state.sslOption : undefined;
resourceInputs["status"] = state ? state.status : undefined;
resourceInputs["subnetId"] = state ? state.subnetId : undefined;
resourceInputs["supportBalanceRouteMode"] = state ? state.supportBalanceRouteMode : undefined;
resourceInputs["supportProxySsl"] = state ? state.supportProxySsl : undefined;
resourceInputs["supportSwitchConnectionPoolType"] = state ? state.supportSwitchConnectionPoolType : undefined;
resourceInputs["supportTransactionSplit"] = state ? state.supportTransactionSplit : undefined;
resourceInputs["transactionSplit"] = state ? state.transactionSplit : undefined;
resourceInputs["vcpus"] = state ? state.vcpus : undefined;
}
else {
const args = argsOrState;
if ((!args || args.flavor === undefined) && !opts.urn) {
throw new Error("Missing required property 'flavor'");
}
if ((!args || args.instanceId === undefined) && !opts.urn) {
throw new Error("Missing required property 'instanceId'");
}
if ((!args || args.nodeNum === undefined) && !opts.urn) {
throw new Error("Missing required property 'nodeNum'");
}
resourceInputs["flavor"] = args ? args.flavor : undefined;
resourceInputs["instanceId"] = args ? args.instanceId : undefined;
resourceInputs["masterNodeWeight"] = args ? args.masterNodeWeight : undefined;
resourceInputs["nodeNum"] = args ? args.nodeNum : undefined;
resourceInputs["proxyMode"] = args ? args.proxyMode : undefined;
resourceInputs["proxyName"] = args ? args.proxyName : undefined;
resourceInputs["readonlyNodesWeights"] = args ? args.readonlyNodesWeights : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["routeMode"] = args ? args.routeMode : undefined;
resourceInputs["subnetId"] = args ? args.subnetId : undefined;
resourceInputs["address"] = undefined /*out*/;
resourceInputs["altFlag"] = undefined /*out*/;
resourceInputs["connectionPoolType"] = undefined /*out*/;
resourceInputs["delayThresholdInSeconds"] = undefined /*out*/;
resourceInputs["dnsName"] = undefined /*out*/;
resourceInputs["flavorGroupType"] = undefined /*out*/;
resourceInputs["forceReadOnly"] = undefined /*out*/;
resourceInputs["memory"] = undefined /*out*/;
resourceInputs["mode"] = undefined /*out*/;
resourceInputs["nodes"] = undefined /*out*/;
resourceInputs["payMode"] = undefined /*out*/;
resourceInputs["port"] = undefined /*out*/;
resourceInputs["secondsLevelMonitorFunStatus"] = undefined /*out*/;
resourceInputs["sslOption"] = undefined /*out*/;
resourceInputs["status"] = undefined /*out*/;
resourceInputs["supportBalanceRouteMode"] = undefined /*out*/;
resourceInputs["supportProxySsl"] = undefined /*out*/;
resourceInputs["supportSwitchConnectionPoolType"] = undefined /*out*/;
resourceInputs["supportTransactionSplit"] = undefined /*out*/;
resourceInputs["transactionSplit"] = undefined /*out*/;
resourceInputs["vcpus"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(MysqlProxy.__pulumiType, name, resourceInputs, opts);
}
}
exports.MysqlProxy = MysqlProxy;
/** @internal */
MysqlProxy.__pulumiType = 'huaweicloud:Rds/mysqlProxy:MysqlProxy';
//# sourceMappingURL=mysqlProxy.js.map