@huaweicloudos/pulumi
Version:
A Pulumi package for creating and managing Huaweicloud cloud resources.
180 lines • 9.27 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.InfluxInstance = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* GeminiDB Influx instance management within HuaweiCould.
*
* ## Example Usage
* ### create a geminidb influx instance with tags
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const instance1 = new huaweicloud.gaussdbfornosql.InfluxInstance("instance1", {
* password: _var.password,
* flavor: "geminidb.influxdb.large.4",
* volumeSize: 100,
* vpcId: _var.vpc_id,
* subnetId: _var.subnet_id,
* securityGroupId: _var.secgroup_id,
* availabilityZone: _var.availability_zone,
* tags: {
* foo: "bar",
* key: "value",
* },
* });
* ```
* ### create a geminidb influx instance with backup strategy
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const instance1 = new huaweicloud.gaussdbfornosql.InfluxInstance("instance1", {
* password: _var.password,
* flavor: "geminidb.influxdb.large.4",
* volumeSize: 100,
* 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 influx instance can be imported using the `id`, e.g. bash
*
* ```sh
* $ pulumi import huaweicloud:GaussDBforNoSQL/influxInstance:InfluxInstance instance_1 e6f6b1fde738489793ce09320d732037in13
* ```
*/
class InfluxInstance extends pulumi.CustomResource {
/**
* Get an existing InfluxInstance 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 InfluxInstance(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of InfluxInstance. 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'] === InfluxInstance.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["autoRenew"] = state ? state.autoRenew : undefined;
resourceInputs["availabilityZone"] = state ? state.availabilityZone : undefined;
resourceInputs["backupStrategy"] = state ? state.backupStrategy : undefined;
resourceInputs["chargingMode"] = state ? state.chargingMode : undefined;
resourceInputs["configurationId"] = state ? state.configurationId : 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["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["autoRenew"] = args ? args.autoRenew : undefined;
resourceInputs["availabilityZone"] = args ? args.availabilityZone : undefined;
resourceInputs["backupStrategy"] = args ? args.backupStrategy : undefined;
resourceInputs["chargingMode"] = args ? args.chargingMode : undefined;
resourceInputs["configurationId"] = args ? args.configurationId : undefined;
resourceInputs["datastore"] = args ? args.datastore : undefined;
resourceInputs["dedicatedResourceId"] = args ? args.dedicatedResourceId : undefined;
resourceInputs["dedicatedResourceName"] = args ? args.dedicatedResourceName : undefined;
resourceInputs["enterpriseProjectId"] = args ? args.enterpriseProjectId : undefined;
resourceInputs["flavor"] = args ? args.flavor : undefined;
resourceInputs["forceImport"] = args ? args.forceImport : 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["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["mode"] = undefined /*out*/;
resourceInputs["nodes"] = undefined /*out*/;
resourceInputs["port"] = undefined /*out*/;
resourceInputs["privateIps"] = undefined /*out*/;
resourceInputs["status"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(InfluxInstance.__pulumiType, name, resourceInputs, opts);
}
}
exports.InfluxInstance = InfluxInstance;
/** @internal */
InfluxInstance.__pulumiType = 'huaweicloud:GaussDBforNoSQL/influxInstance:InfluxInstance';
//# sourceMappingURL=influxInstance.js.map