UNPKG

@volcengine/pulumi

Version:

A Pulumi package for creating and managing volcengine cloud resources.

147 lines 6.93 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.RdsInstanceV2 = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * (Deprecated! Recommend use volcengine_rds_mysql_*** replace) Provides a resource to manage rds instance v2 * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as volcengine from "@pulumi/volcengine"; * import * as volcengine from "@volcengine/pulumi"; * * const fooZones = volcengine.ecs.getZones({}); * const fooVpc = new volcengine.vpc.Vpc("fooVpc", { * vpcName: "acc-test-vpc", * cidrBlock: "172.16.0.0/16", * }); * const fooSubnet = new volcengine.vpc.Subnet("fooSubnet", { * subnetName: "acc-test-subnet", * cidrBlock: "172.16.0.0/24", * zoneId: fooZones.then(fooZones => fooZones.zones?.[0]?.id), * vpcId: fooVpc.id, * }); * const fooRdsInstanceV2 = new volcengine.rds_v2.RdsInstanceV2("fooRdsInstanceV2", { * dbEngineVersion: "MySQL_5_7", * nodeInfos: [ * { * nodeType: "Primary", * nodeSpec: "rds.mysql.2c4g", * zoneId: fooZones.then(fooZones => fooZones.zones?.[0]?.id), * }, * { * nodeType: "Secondary", * nodeSpec: "rds.mysql.2c4g", * zoneId: fooZones.then(fooZones => fooZones.zones?.[0]?.id), * }, * ], * storageType: "LocalSSD", * storageSpace: 100, * vpcId: fooVpc.id, * subnetId: fooSubnet.id, * instanceName: "tf-test-v2", * lowerCaseTableNames: "1", * chargeInfo: { * chargeType: "PostPaid", * }, * }); * ``` * * ## Import * * RDS Instance can be imported using the id, e.g. * * ```sh * $ pulumi import volcengine:rds_v2/rdsInstanceV2:RdsInstanceV2 default mysql-42b38c769c4b * ``` */ class RdsInstanceV2 extends pulumi.CustomResource { /** * Get an existing RdsInstanceV2 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 RdsInstanceV2(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of RdsInstanceV2. 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'] === RdsInstanceV2.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["chargeInfo"] = state ? state.chargeInfo : undefined; resourceInputs["connectionInfos"] = state ? state.connectionInfos : undefined; resourceInputs["dbEngineVersion"] = state ? state.dbEngineVersion : undefined; resourceInputs["dbParamGroupId"] = state ? state.dbParamGroupId : undefined; resourceInputs["dbTimeZone"] = state ? state.dbTimeZone : undefined; resourceInputs["instanceName"] = state ? state.instanceName : undefined; resourceInputs["instanceType"] = state ? state.instanceType : undefined; resourceInputs["lowerCaseTableNames"] = state ? state.lowerCaseTableNames : undefined; resourceInputs["nodeInfos"] = state ? state.nodeInfos : undefined; resourceInputs["projectName"] = state ? state.projectName : undefined; resourceInputs["storageSpace"] = state ? state.storageSpace : undefined; resourceInputs["storageType"] = state ? state.storageType : undefined; resourceInputs["subnetId"] = state ? state.subnetId : undefined; resourceInputs["vpcId"] = state ? state.vpcId : undefined; } else { const args = argsOrState; if ((!args || args.chargeInfo === undefined) && !opts.urn) { throw new Error("Missing required property 'chargeInfo'"); } if ((!args || args.dbEngineVersion === undefined) && !opts.urn) { throw new Error("Missing required property 'dbEngineVersion'"); } if ((!args || args.nodeInfos === undefined) && !opts.urn) { throw new Error("Missing required property 'nodeInfos'"); } if ((!args || args.storageType === undefined) && !opts.urn) { throw new Error("Missing required property 'storageType'"); } 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["chargeInfo"] = args ? args.chargeInfo : undefined; resourceInputs["dbEngineVersion"] = args ? args.dbEngineVersion : undefined; resourceInputs["dbParamGroupId"] = args ? args.dbParamGroupId : undefined; resourceInputs["dbTimeZone"] = args ? args.dbTimeZone : undefined; resourceInputs["instanceName"] = args ? args.instanceName : undefined; resourceInputs["instanceType"] = args ? args.instanceType : undefined; resourceInputs["lowerCaseTableNames"] = args ? args.lowerCaseTableNames : undefined; resourceInputs["nodeInfos"] = args ? args.nodeInfos : undefined; resourceInputs["projectName"] = args ? args.projectName : undefined; resourceInputs["storageSpace"] = args ? args.storageSpace : undefined; resourceInputs["storageType"] = args ? args.storageType : undefined; resourceInputs["subnetId"] = args ? args.subnetId : undefined; resourceInputs["vpcId"] = args ? args.vpcId : undefined; resourceInputs["connectionInfos"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(RdsInstanceV2.__pulumiType, name, resourceInputs, opts); } } exports.RdsInstanceV2 = RdsInstanceV2; /** @internal */ RdsInstanceV2.__pulumiType = 'volcengine:rds_v2/rdsInstanceV2:RdsInstanceV2'; //# sourceMappingURL=rdsInstanceV2.js.map