UNPKG

@huaweicloudos/pulumi

Version:

A Pulumi package for creating and managing Huaweicloud cloud resources.

234 lines 14.3 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.MysqlInstance = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * GaussDB mysql instance management within HuaweiCould. * * ## Example Usage * ### create a basic instance * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as pulumi from "@huaweicloudos/pulumi"; * * const instance1 = new huaweicloud.gaussdb.MysqlInstance("instance1", { * password: _var.password, * flavor: "gaussdb.mysql.4xlarge.x86.4", * vpcId: _var.vpc_id, * subnetId: _var.subnet_id, * securityGroupId: _var.secgroup_id, * }); * ``` * ### create a gaussdb mysql instance with backup strategy * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as pulumi from "@huaweicloudos/pulumi"; * * const instance1 = new huaweicloud.gaussdb.MysqlInstance("instance1", { * password: _var.password, * flavor: "gaussdb.mysql.4xlarge.x86.4", * vpcId: _var.vpc_id, * subnetId: _var.subnet_id, * securityGroupId: _var.secgroup_id, * backupStrategy: { * startTime: "03:00-04:00", * keepDays: 7, * }, * }); * ``` * * ## Import * * GaussDB instance can be imported using the `id`, e.g. bash * * ```sh * $ pulumi import huaweicloud:GaussDB/mysqlInstance:MysqlInstance test <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`table_name_case_sensitivity`, `enterprise_project_id`, `password`, `ssl_option`, `encryption_type`, `kms_key_id` and `parameters`. It is generally recommended running `terraform plan` after importing a GaussDB MySQL instance. You can then decide if changes should be applied to the GaussDB MySQL instance, or the resource definition should be updated to align with the GaussDB MySQL instance. Also you can ignore changes as below. hcl resource "huaweicloud_gaussdb_mysql_instance" "test" { * * ... * * lifecycle { * * ignore_changes = [ * * new_node_weight, proxy_mode, readonly_nodes_weight, parameters, ssl_option, encryption_type, kms_key_id * * ] * * } } */ class MysqlInstance extends pulumi.CustomResource { /** * Get an existing MysqlInstance 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 MysqlInstance(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of MysqlInstance. 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'] === MysqlInstance.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["auditLogEnabled"] = state ? state.auditLogEnabled : undefined; resourceInputs["autoPay"] = state ? state.autoPay : undefined; resourceInputs["autoRenew"] = state ? state.autoRenew : undefined; resourceInputs["autoScaling"] = state ? state.autoScaling : undefined; resourceInputs["availabilityZoneMode"] = state ? state.availabilityZoneMode : undefined; resourceInputs["backupStrategy"] = state ? state.backupStrategy : undefined; resourceInputs["chargingMode"] = state ? state.chargingMode : undefined; resourceInputs["configurationId"] = state ? state.configurationId : undefined; resourceInputs["configurationName"] = state ? state.configurationName : undefined; resourceInputs["createdAt"] = state ? state.createdAt : undefined; resourceInputs["currentKernelVersion"] = state ? state.currentKernelVersion : undefined; resourceInputs["currentVersion"] = state ? state.currentVersion : undefined; resourceInputs["datastore"] = state ? state.datastore : undefined; resourceInputs["dbUserName"] = state ? state.dbUserName : undefined; resourceInputs["dedicatedResourceId"] = state ? state.dedicatedResourceId : undefined; resourceInputs["dedicatedResourceName"] = state ? state.dedicatedResourceName : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["encryptionStatus"] = state ? state.encryptionStatus : undefined; resourceInputs["encryptionType"] = state ? state.encryptionType : undefined; resourceInputs["enterpriseProjectId"] = state ? state.enterpriseProjectId : undefined; resourceInputs["flavor"] = state ? state.flavor : undefined; resourceInputs["forceImport"] = state ? state.forceImport : undefined; resourceInputs["kmsKeyId"] = state ? state.kmsKeyId : undefined; resourceInputs["maintainBegin"] = state ? state.maintainBegin : undefined; resourceInputs["maintainEnd"] = state ? state.maintainEnd : undefined; resourceInputs["masterAvailabilityZone"] = state ? state.masterAvailabilityZone : undefined; resourceInputs["mode"] = state ? state.mode : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["nodes"] = state ? state.nodes : undefined; resourceInputs["parameters"] = state ? state.parameters : undefined; resourceInputs["password"] = state ? state.password : undefined; resourceInputs["period"] = state ? state.period : undefined; resourceInputs["periodUnit"] = state ? state.periodUnit : undefined; resourceInputs["port"] = state ? state.port : undefined; resourceInputs["privateDnsName"] = state ? state.privateDnsName : undefined; resourceInputs["privateDnsNamePrefix"] = state ? state.privateDnsNamePrefix : undefined; resourceInputs["privateWriteIp"] = state ? state.privateWriteIp : undefined; resourceInputs["proxyAddress"] = state ? state.proxyAddress : undefined; resourceInputs["proxyFlavor"] = state ? state.proxyFlavor : undefined; resourceInputs["proxyNodeNum"] = state ? state.proxyNodeNum : undefined; resourceInputs["proxyPort"] = state ? state.proxyPort : undefined; resourceInputs["readReplicas"] = state ? state.readReplicas : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["secondsLevelMonitoringEnabled"] = state ? state.secondsLevelMonitoringEnabled : undefined; resourceInputs["secondsLevelMonitoringPeriod"] = state ? state.secondsLevelMonitoringPeriod : undefined; resourceInputs["securityGroupId"] = state ? state.securityGroupId : undefined; resourceInputs["slowLogShowOriginalSwitch"] = state ? state.slowLogShowOriginalSwitch : undefined; resourceInputs["sqlFilterEnabled"] = state ? state.sqlFilterEnabled : undefined; resourceInputs["sslOption"] = state ? state.sslOption : undefined; resourceInputs["status"] = state ? state.status : undefined; resourceInputs["subnetId"] = state ? state.subnetId : undefined; resourceInputs["tableNameCaseSensitivity"] = state ? state.tableNameCaseSensitivity : undefined; resourceInputs["tags"] = state ? state.tags : undefined; resourceInputs["timeZone"] = state ? state.timeZone : undefined; resourceInputs["updatedAt"] = state ? state.updatedAt : undefined; resourceInputs["upgradeFlag"] = state ? state.upgradeFlag : undefined; resourceInputs["volumeSize"] = state ? state.volumeSize : undefined; resourceInputs["vpcId"] = state ? state.vpcId : undefined; } else { const args = argsOrState; if ((!args || args.flavor === undefined) && !opts.urn) { throw new Error("Missing required property 'flavor'"); } if ((!args || args.password === undefined) && !opts.urn) { throw new Error("Missing required property 'password'"); } if ((!args || args.subnetId === undefined) && !opts.urn) { throw new Error("Missing required property 'subnetId'"); } if ((!args || args.vpcId === undefined) && !opts.urn) { throw new Error("Missing required property 'vpcId'"); } resourceInputs["auditLogEnabled"] = args ? args.auditLogEnabled : undefined; resourceInputs["autoPay"] = args ? args.autoPay : undefined; resourceInputs["autoRenew"] = args ? args.autoRenew : undefined; resourceInputs["autoScaling"] = args ? args.autoScaling : undefined; resourceInputs["availabilityZoneMode"] = args ? args.availabilityZoneMode : undefined; resourceInputs["backupStrategy"] = args ? args.backupStrategy : undefined; resourceInputs["chargingMode"] = args ? args.chargingMode : undefined; resourceInputs["configurationId"] = args ? args.configurationId : undefined; resourceInputs["configurationName"] = args ? args.configurationName : undefined; resourceInputs["datastore"] = args ? args.datastore : undefined; resourceInputs["dedicatedResourceId"] = args ? args.dedicatedResourceId : undefined; resourceInputs["dedicatedResourceName"] = args ? args.dedicatedResourceName : undefined; resourceInputs["description"] = args ? args.description : undefined; resourceInputs["encryptionStatus"] = args ? args.encryptionStatus : undefined; resourceInputs["encryptionType"] = args ? args.encryptionType : undefined; resourceInputs["enterpriseProjectId"] = args ? args.enterpriseProjectId : undefined; resourceInputs["flavor"] = args ? args.flavor : undefined; resourceInputs["forceImport"] = args ? args.forceImport : undefined; resourceInputs["kmsKeyId"] = args ? args.kmsKeyId : undefined; resourceInputs["maintainBegin"] = args ? args.maintainBegin : undefined; resourceInputs["maintainEnd"] = args ? args.maintainEnd : undefined; resourceInputs["masterAvailabilityZone"] = args ? args.masterAvailabilityZone : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["parameters"] = args ? args.parameters : undefined; resourceInputs["password"] = args ? args.password : undefined; resourceInputs["period"] = args ? args.period : undefined; resourceInputs["periodUnit"] = args ? args.periodUnit : undefined; resourceInputs["port"] = args ? args.port : undefined; resourceInputs["privateDnsNamePrefix"] = args ? args.privateDnsNamePrefix : undefined; resourceInputs["privateWriteIp"] = args ? args.privateWriteIp : undefined; resourceInputs["proxyFlavor"] = args ? args.proxyFlavor : undefined; resourceInputs["proxyNodeNum"] = args ? args.proxyNodeNum : undefined; resourceInputs["readReplicas"] = args ? args.readReplicas : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["secondsLevelMonitoringEnabled"] = args ? args.secondsLevelMonitoringEnabled : undefined; resourceInputs["secondsLevelMonitoringPeriod"] = args ? args.secondsLevelMonitoringPeriod : undefined; resourceInputs["securityGroupId"] = args ? args.securityGroupId : undefined; resourceInputs["slowLogShowOriginalSwitch"] = args ? args.slowLogShowOriginalSwitch : undefined; resourceInputs["sqlFilterEnabled"] = args ? args.sqlFilterEnabled : undefined; resourceInputs["sslOption"] = args ? args.sslOption : undefined; resourceInputs["subnetId"] = args ? args.subnetId : undefined; resourceInputs["tableNameCaseSensitivity"] = args ? args.tableNameCaseSensitivity : undefined; resourceInputs["tags"] = args ? args.tags : undefined; resourceInputs["timeZone"] = args ? args.timeZone : undefined; resourceInputs["volumeSize"] = args ? args.volumeSize : undefined; resourceInputs["vpcId"] = args ? args.vpcId : undefined; resourceInputs["createdAt"] = undefined /*out*/; resourceInputs["currentKernelVersion"] = undefined /*out*/; resourceInputs["currentVersion"] = undefined /*out*/; resourceInputs["dbUserName"] = undefined /*out*/; resourceInputs["mode"] = undefined /*out*/; resourceInputs["nodes"] = undefined /*out*/; resourceInputs["privateDnsName"] = undefined /*out*/; resourceInputs["proxyAddress"] = undefined /*out*/; resourceInputs["proxyPort"] = undefined /*out*/; resourceInputs["status"] = undefined /*out*/; resourceInputs["updatedAt"] = undefined /*out*/; resourceInputs["upgradeFlag"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(MysqlInstance.__pulumiType, name, resourceInputs, opts); } } exports.MysqlInstance = MysqlInstance; /** @internal */ MysqlInstance.__pulumiType = 'huaweicloud:GaussDB/mysqlInstance:MysqlInstance'; //# sourceMappingURL=mysqlInstance.js.map