UNPKG

@volcengine/pulumi

Version:

A Pulumi package for creating and managing volcengine cloud resources.

149 lines 7 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.Instance = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Provides a resource to manage rds mssql instance * ## 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 fooInstance = new volcengine.rds_mssql.Instance("fooInstance", { * dbEngineVersion: "SQLServer_2019_Std", * instanceType: "HA", * nodeSpec: "rds.mssql.se.ha.d2.2c4g", * storageSpace: 20, * subnetIds: [fooSubnet.id], * superAccountPassword: "Tftest110", * instanceName: "acc-test-mssql", * projectName: "default", * chargeInfo: { * chargeType: "PostPaid", * }, * tags: [{ * key: "k1", * value: "v1", * }], * backupTime: "18:00Z-19:00Z", * fullBackupPeriods: [ * "Monday", * "Tuesday", * ], * backupRetentionPeriod: 14, * }); * ``` * * ## Import * * Rds Mssql Instance can be imported using the id, e.g. * * ```sh * $ pulumi import volcengine:rds_mssql/instance:Instance default resource_id * ``` */ class Instance extends pulumi.CustomResource { /** * Get an existing Instance 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 Instance(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of Instance. 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'] === Instance.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["backupRetentionPeriod"] = state ? state.backupRetentionPeriod : undefined; resourceInputs["backupTime"] = state ? state.backupTime : undefined; resourceInputs["chargeInfo"] = state ? state.chargeInfo : undefined; resourceInputs["dbEngineVersion"] = state ? state.dbEngineVersion : undefined; resourceInputs["fullBackupPeriods"] = state ? state.fullBackupPeriods : undefined; resourceInputs["instanceName"] = state ? state.instanceName : undefined; resourceInputs["instanceType"] = state ? state.instanceType : undefined; resourceInputs["nodeSpec"] = state ? state.nodeSpec : undefined; resourceInputs["projectName"] = state ? state.projectName : undefined; resourceInputs["storageSpace"] = state ? state.storageSpace : undefined; resourceInputs["subnetIds"] = state ? state.subnetIds : undefined; resourceInputs["superAccountPassword"] = state ? state.superAccountPassword : undefined; resourceInputs["tags"] = state ? state.tags : 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.instanceType === undefined) && !opts.urn) { throw new Error("Missing required property 'instanceType'"); } if ((!args || args.nodeSpec === undefined) && !opts.urn) { throw new Error("Missing required property 'nodeSpec'"); } if ((!args || args.storageSpace === undefined) && !opts.urn) { throw new Error("Missing required property 'storageSpace'"); } if ((!args || args.subnetIds === undefined) && !opts.urn) { throw new Error("Missing required property 'subnetIds'"); } if ((!args || args.superAccountPassword === undefined) && !opts.urn) { throw new Error("Missing required property 'superAccountPassword'"); } resourceInputs["backupRetentionPeriod"] = args ? args.backupRetentionPeriod : undefined; resourceInputs["backupTime"] = args ? args.backupTime : undefined; resourceInputs["chargeInfo"] = args ? args.chargeInfo : undefined; resourceInputs["dbEngineVersion"] = args ? args.dbEngineVersion : undefined; resourceInputs["fullBackupPeriods"] = args ? args.fullBackupPeriods : undefined; resourceInputs["instanceName"] = args ? args.instanceName : undefined; resourceInputs["instanceType"] = args ? args.instanceType : undefined; resourceInputs["nodeSpec"] = args ? args.nodeSpec : undefined; resourceInputs["projectName"] = args ? args.projectName : undefined; resourceInputs["storageSpace"] = args ? args.storageSpace : undefined; resourceInputs["subnetIds"] = args ? args.subnetIds : undefined; resourceInputs["superAccountPassword"] = (args === null || args === void 0 ? void 0 : args.superAccountPassword) ? pulumi.secret(args.superAccountPassword) : undefined; resourceInputs["tags"] = args ? args.tags : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const secretOpts = { additionalSecretOutputs: ["superAccountPassword"] }; opts = pulumi.mergeOptions(opts, secretOpts); super(Instance.__pulumiType, name, resourceInputs, opts); } } exports.Instance = Instance; /** @internal */ Instance.__pulumiType = 'volcengine:rds_mssql/instance:Instance'; //# sourceMappingURL=instance.js.map