UNPKG

@huaweicloudos/pulumi

Version:

A Pulumi package for creating and managing Huaweicloud cloud resources.

178 lines 9.03 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.RedisInstance = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * GeminiDB Redis instance management within HuaweiCould. * * ## Example Usage * ### create a geminidb redis instance with tags * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as pulumi from "@huaweicloudos/pulumi"; * * const test = new huaweicloud.gaussdbfornosql.RedisInstance("test", { * password: _var.password, * flavor: "geminidb.redis.xlarge.4", * volumeSize: 16, * vpcId: _var.vpc_id, * subnetId: _var.subnet_id, * securityGroupId: _var.secgroup_id, * availabilityZone: _var.availability_zone, * tags: { * foo: "bar", * key: "value", * }, * }); * ``` * ### create a geminidb redis instance with backup strategy * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as pulumi from "@huaweicloudos/pulumi"; * * const test = new huaweicloud.gaussdbfornosql.RedisInstance("test", { * password: _var.password, * flavor: "geminidb.redis.xlarge.4", * volumeSize: 16, * vpcId: _var.vpc_id, * subnetId: _var.subnet_id, * securityGroupId: _var.secgroup_id, * availabilityZone: _var.availability_zone, * backupStrategy: { * startTime: "03:00-04:00", * keepDays: 14, * }, * }); * ``` * * ## Import * * GaussDB Redis instance can be imported using the `id`, e.g. bash * * ```sh * $ pulumi import huaweicloud:GaussDBforNoSQL/redisInstance:RedisInstance instance_1 d54b21f037ed447aad4bfd20927711c6in12 * ``` */ class RedisInstance extends pulumi.CustomResource { /** * Get an existing RedisInstance 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 RedisInstance(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of RedisInstance. 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'] === RedisInstance.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["autoPay"] = state ? state.autoPay : undefined; resourceInputs["autoRenew"] = state ? state.autoRenew : undefined; resourceInputs["availabilityZone"] = state ? state.availabilityZone : undefined; resourceInputs["availabilityZoneDetail"] = state ? state.availabilityZoneDetail : undefined; resourceInputs["backupStrategy"] = state ? state.backupStrategy : undefined; resourceInputs["chargingMode"] = state ? state.chargingMode : undefined; resourceInputs["datastore"] = state ? state.datastore : undefined; resourceInputs["dbUserName"] = state ? state.dbUserName : undefined; resourceInputs["enterpriseProjectId"] = state ? state.enterpriseProjectId : undefined; resourceInputs["flavor"] = state ? state.flavor : undefined; resourceInputs["forceImport"] = state ? state.forceImport : undefined; resourceInputs["lbIpAddress"] = state ? state.lbIpAddress : undefined; resourceInputs["lbPort"] = state ? state.lbPort : undefined; resourceInputs["mode"] = state ? state.mode : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["nodeNum"] = state ? state.nodeNum : undefined; resourceInputs["nodes"] = state ? state.nodes : 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["privateIps"] = state ? state.privateIps : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["securityGroupId"] = state ? state.securityGroupId : undefined; resourceInputs["ssl"] = state ? state.ssl : undefined; resourceInputs["status"] = state ? state.status : undefined; resourceInputs["subnetId"] = state ? state.subnetId : undefined; resourceInputs["tags"] = state ? state.tags : undefined; resourceInputs["volumeSize"] = state ? state.volumeSize : undefined; resourceInputs["vpcId"] = state ? state.vpcId : undefined; } else { const args = argsOrState; if ((!args || args.availabilityZone === undefined) && !opts.urn) { throw new Error("Missing required property 'availabilityZone'"); } 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.volumeSize === undefined) && !opts.urn) { throw new Error("Missing required property 'volumeSize'"); } if ((!args || args.vpcId === undefined) && !opts.urn) { throw new Error("Missing required property 'vpcId'"); } resourceInputs["autoPay"] = args ? args.autoPay : undefined; resourceInputs["autoRenew"] = args ? args.autoRenew : undefined; resourceInputs["availabilityZone"] = args ? args.availabilityZone : undefined; resourceInputs["availabilityZoneDetail"] = args ? args.availabilityZoneDetail : undefined; resourceInputs["backupStrategy"] = args ? args.backupStrategy : undefined; resourceInputs["chargingMode"] = args ? args.chargingMode : undefined; resourceInputs["datastore"] = args ? args.datastore : undefined; resourceInputs["enterpriseProjectId"] = args ? args.enterpriseProjectId : undefined; resourceInputs["flavor"] = args ? args.flavor : undefined; resourceInputs["forceImport"] = args ? args.forceImport : undefined; resourceInputs["mode"] = args ? args.mode : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["nodeNum"] = args ? args.nodeNum : 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["region"] = args ? args.region : undefined; resourceInputs["securityGroupId"] = args ? args.securityGroupId : undefined; resourceInputs["ssl"] = args ? args.ssl : undefined; resourceInputs["subnetId"] = args ? args.subnetId : undefined; resourceInputs["tags"] = args ? args.tags : undefined; resourceInputs["volumeSize"] = args ? args.volumeSize : undefined; resourceInputs["vpcId"] = args ? args.vpcId : undefined; resourceInputs["dbUserName"] = undefined /*out*/; resourceInputs["lbIpAddress"] = undefined /*out*/; resourceInputs["lbPort"] = undefined /*out*/; resourceInputs["nodes"] = undefined /*out*/; resourceInputs["privateIps"] = undefined /*out*/; resourceInputs["status"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(RedisInstance.__pulumiType, name, resourceInputs, opts); } } exports.RedisInstance = RedisInstance; /** @internal */ RedisInstance.__pulumiType = 'huaweicloud:GaussDBforNoSQL/redisInstance:RedisInstance'; //# sourceMappingURL=redisInstance.js.map