UNPKG

@huaweicloudos/pulumi

Version:

A Pulumi package for creating and managing Huaweicloud cloud resources.

146 lines 8.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.MysqlProxy = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages GaussDB 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 test = new huaweicloud.gaussdb.MysqlProxy("test", { * instanceId: instanceId, * flavor: "gaussdb.proxy.xlarge.x86.2", * nodeNum: 3, * }); * ``` * * ## Import * * The GaussDB MySQL proxy can be imported using the `instance_id` and `id` separated by a slash, e.g. bash * * ```sh * $ pulumi import huaweicloud:GaussDB/mysqlProxy:MysqlProxy test <instance_id>/<id> * ``` * * Note that the imported state may not be identical to your resource definition, due to the attribute missing from the API response. The missing attribute is`new_node_weight`, `proxy_mode`, `readonly_nodes_weight` and `parameters`. It is generally recommended running `terraform plan` after importing a GaussDB MySQL proxy. You can then decide if changes should be applied to the GaussDB MySQL proxy, or the resource definition should be updated to align with the GaussDB MySQL proxy. Also you can ignore changes as below. hcl resource "huaweicloud_gaussdb_mysql_proxy" "test" { * * ... * * lifecycle { * * ignore_changes = [ * * new_node_weight, proxy_mode, readonly_nodes_weight, parameters, * * ] * * } } */ 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["accessControlIpLists"] = state ? state.accessControlIpLists : undefined; resourceInputs["accessControlType"] = state ? state.accessControlType : undefined; resourceInputs["address"] = state ? state.address : undefined; resourceInputs["canUpgrade"] = state ? state.canUpgrade : undefined; resourceInputs["connectionPoolType"] = state ? state.connectionPoolType : undefined; resourceInputs["consistenceMode"] = state ? state.consistenceMode : undefined; resourceInputs["currentVersion"] = state ? state.currentVersion : undefined; resourceInputs["flavor"] = state ? state.flavor : undefined; resourceInputs["instanceId"] = state ? state.instanceId : undefined; resourceInputs["masterNodeWeight"] = state ? state.masterNodeWeight : undefined; resourceInputs["newNodeAutoAddStatus"] = state ? state.newNodeAutoAddStatus : undefined; resourceInputs["newNodeWeight"] = state ? state.newNodeWeight : undefined; resourceInputs["nodeNum"] = state ? state.nodeNum : undefined; resourceInputs["nodes"] = state ? state.nodes : undefined; resourceInputs["openAccessControl"] = state ? state.openAccessControl : undefined; resourceInputs["parameters"] = state ? state.parameters : 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["subnetId"] = state ? state.subnetId : undefined; resourceInputs["switchConnectionPoolTypeEnabled"] = state ? state.switchConnectionPoolTypeEnabled : undefined; resourceInputs["transactionSplit"] = state ? state.transactionSplit : 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["accessControlIpLists"] = args ? args.accessControlIpLists : undefined; resourceInputs["accessControlType"] = args ? args.accessControlType : undefined; resourceInputs["connectionPoolType"] = args ? args.connectionPoolType : undefined; resourceInputs["consistenceMode"] = args ? args.consistenceMode : undefined; resourceInputs["flavor"] = args ? args.flavor : undefined; resourceInputs["instanceId"] = args ? args.instanceId : undefined; resourceInputs["masterNodeWeight"] = args ? args.masterNodeWeight : undefined; resourceInputs["newNodeAutoAddStatus"] = args ? args.newNodeAutoAddStatus : undefined; resourceInputs["newNodeWeight"] = args ? args.newNodeWeight : undefined; resourceInputs["nodeNum"] = args ? args.nodeNum : undefined; resourceInputs["openAccessControl"] = args ? args.openAccessControl : undefined; resourceInputs["parameters"] = args ? args.parameters : undefined; resourceInputs["port"] = args ? args.port : 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["transactionSplit"] = args ? args.transactionSplit : undefined; resourceInputs["address"] = undefined /*out*/; resourceInputs["canUpgrade"] = undefined /*out*/; resourceInputs["currentVersion"] = undefined /*out*/; resourceInputs["nodes"] = undefined /*out*/; resourceInputs["switchConnectionPoolTypeEnabled"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(MysqlProxy.__pulumiType, name, resourceInputs, opts); } } exports.MysqlProxy = MysqlProxy; /** @internal */ MysqlProxy.__pulumiType = 'huaweicloud:GaussDB/mysqlProxy:MysqlProxy'; //# sourceMappingURL=mysqlProxy.js.map