@volcengine/pulumi
Version:
A Pulumi package for creating and managing volcengine cloud resources.
145 lines • 7.49 kB
JavaScript
;
// *** 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");
/**
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as volcengine from "@volcengine/pulumi";
*
* const foo = new volcengine.rds.Instance("foo", {
* chargeType: "PostPaid",
* dbEngine: "MySQL",
* dbEngineVersion: "MySQL_Community_5_7",
* instanceName: "tf-test",
* instanceSpecName: "rds.mysql.1c2g",
* instanceType: "HA",
* region: "cn-north-4",
* storageSpaceGb: 100,
* storageType: "LocalSSD",
* subnetId: "subnet-1g0d4fkh1nabk8ibuxx1jtvss",
* vpcId: "vpc-3cj17x7u9bzeo6c6rrtzfpaeb",
* zone: "cn-langfang-b",
* });
* ```
*
* ## Import
*
* RDS Instance can be imported using the id, e.g.
*
* ```sh
* $ pulumi import volcengine:rds/instance:Instance default mysql-42b38c769c4b
* ```
*/
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["autoRenew"] = state ? state.autoRenew : undefined;
resourceInputs["chargeType"] = state ? state.chargeType : undefined;
resourceInputs["connectionInfo"] = state ? state.connectionInfo : undefined;
resourceInputs["dbEngine"] = state ? state.dbEngine : undefined;
resourceInputs["dbEngineVersion"] = state ? state.dbEngineVersion : undefined;
resourceInputs["instanceName"] = state ? state.instanceName : undefined;
resourceInputs["instanceSpecName"] = state ? state.instanceSpecName : undefined;
resourceInputs["instanceType"] = state ? state.instanceType : undefined;
resourceInputs["prepaidPeriod"] = state ? state.prepaidPeriod : undefined;
resourceInputs["projectName"] = state ? state.projectName : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["storageSpaceGb"] = state ? state.storageSpaceGb : undefined;
resourceInputs["storageType"] = state ? state.storageType : undefined;
resourceInputs["subnetId"] = state ? state.subnetId : undefined;
resourceInputs["superAccountName"] = state ? state.superAccountName : undefined;
resourceInputs["superAccountPassword"] = state ? state.superAccountPassword : undefined;
resourceInputs["supperAccountPassword"] = state ? state.supperAccountPassword : undefined;
resourceInputs["usedTime"] = state ? state.usedTime : undefined;
resourceInputs["vpcId"] = state ? state.vpcId : undefined;
resourceInputs["zone"] = state ? state.zone : undefined;
}
else {
const args = argsOrState;
if ((!args || args.chargeType === undefined) && !opts.urn) {
throw new Error("Missing required property 'chargeType'");
}
if ((!args || args.dbEngineVersion === undefined) && !opts.urn) {
throw new Error("Missing required property 'dbEngineVersion'");
}
if ((!args || args.instanceSpecName === undefined) && !opts.urn) {
throw new Error("Missing required property 'instanceSpecName'");
}
if ((!args || args.instanceType === undefined) && !opts.urn) {
throw new Error("Missing required property 'instanceType'");
}
if ((!args || args.storageSpaceGb === undefined) && !opts.urn) {
throw new Error("Missing required property 'storageSpaceGb'");
}
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'");
}
if ((!args || args.zone === undefined) && !opts.urn) {
throw new Error("Missing required property 'zone'");
}
resourceInputs["autoRenew"] = args ? args.autoRenew : undefined;
resourceInputs["chargeType"] = args ? args.chargeType : undefined;
resourceInputs["dbEngine"] = args ? args.dbEngine : undefined;
resourceInputs["dbEngineVersion"] = args ? args.dbEngineVersion : undefined;
resourceInputs["instanceName"] = args ? args.instanceName : undefined;
resourceInputs["instanceSpecName"] = args ? args.instanceSpecName : undefined;
resourceInputs["instanceType"] = args ? args.instanceType : undefined;
resourceInputs["prepaidPeriod"] = args ? args.prepaidPeriod : undefined;
resourceInputs["projectName"] = args ? args.projectName : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["storageSpaceGb"] = args ? args.storageSpaceGb : undefined;
resourceInputs["storageType"] = args ? args.storageType : undefined;
resourceInputs["subnetId"] = args ? args.subnetId : undefined;
resourceInputs["superAccountName"] = args ? args.superAccountName : undefined;
resourceInputs["superAccountPassword"] = args ? args.superAccountPassword : undefined;
resourceInputs["supperAccountPassword"] = args ? args.supperAccountPassword : undefined;
resourceInputs["usedTime"] = args ? args.usedTime : undefined;
resourceInputs["vpcId"] = args ? args.vpcId : undefined;
resourceInputs["zone"] = args ? args.zone : undefined;
resourceInputs["connectionInfo"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Instance.__pulumiType, name, resourceInputs, opts);
}
}
exports.Instance = Instance;
/** @internal */
Instance.__pulumiType = 'volcengine:rds/instance:Instance';
//# sourceMappingURL=instance.js.map