@volcengine/pulumi
Version:
A Pulumi package for creating and managing volcengine cloud resources.
227 lines • 10.9 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 "@pulumi/volcengine";
* import * as volcengine from "@volcengine/pulumi";
*
* const fooZones = volcengine.ecs.getZones({});
* // create vpc
* const fooVpc = new volcengine.vpc.Vpc("fooVpc", {
* vpcName: "acc-test-vpc",
* cidrBlock: "172.16.0.0/16",
* dnsServers: [
* "8.8.8.8",
* "114.114.114.114",
* ],
* projectName: "default",
* });
* // create subnet
* 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,
* });
* // create redis instance
* const fooInstance = new volcengine.redis.Instance("fooInstance", {
* instanceName: "tf-test2",
* shardedCluster: 1,
* password: "1qaz!QAZ12",
* nodeNumber: 4,
* shardCapacity: 1024,
* shardNumber: 2,
* engineVersion: "5.0",
* subnetId: fooSubnet.id,
* deletionProtection: "disabled",
* vpcAuthMode: "close",
* chargeType: "PostPaid",
* port: 6381,
* projectName: "default",
* tags: [
* {
* key: "k1",
* value: "v1",
* },
* {
* key: "k3",
* value: "v3",
* },
* ],
* paramValues: [
* {
* name: "active-defrag-cycle-min",
* value: "5",
* },
* {
* name: "active-defrag-cycle-max",
* value: "28",
* },
* ],
* backupPeriods: [
* 1,
* 2,
* 3,
* ],
* backupHour: 6,
* backupActive: true,
* createBackup: false,
* applyImmediately: true,
* multiAz: "enabled",
* configureNodes: [
* {
* az: "cn-beijing-a",
* },
* {
* az: "cn-beijing-b",
* },
* {
* az: "cn-beijing-c",
* },
* {
* az: "cn-beijing-b",
* },
* ],
* });
* ```
*
* ## Import
*
* redis instance can be imported using the id, e.g.
*
* ```sh
* $ pulumi import volcengine:redis/instance:Instance default redis-n769ewmjjqyqh5dv
* ```
* Adding or removing nodes and migrating availability zones for multiple AZ instances are not supported to be orchestrated simultaneously, but it is possible for single AZ instances.
*/
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["additionalBandwidth"] = state ? state.additionalBandwidth : undefined;
resourceInputs["addrType"] = state ? state.addrType : undefined;
resourceInputs["applyImmediately"] = state ? state.applyImmediately : undefined;
resourceInputs["autoRenew"] = state ? state.autoRenew : undefined;
resourceInputs["backupActive"] = state ? state.backupActive : undefined;
resourceInputs["backupHour"] = state ? state.backupHour : undefined;
resourceInputs["backupPeriods"] = state ? state.backupPeriods : undefined;
resourceInputs["backupPointName"] = state ? state.backupPointName : undefined;
resourceInputs["chargeType"] = state ? state.chargeType : undefined;
resourceInputs["configureNodes"] = state ? state.configureNodes : undefined;
resourceInputs["createBackup"] = state ? state.createBackup : undefined;
resourceInputs["deletionProtection"] = state ? state.deletionProtection : undefined;
resourceInputs["engineVersion"] = state ? state.engineVersion : undefined;
resourceInputs["instanceName"] = state ? state.instanceName : undefined;
resourceInputs["maxConnections"] = state ? state.maxConnections : undefined;
resourceInputs["multiAz"] = state ? state.multiAz : undefined;
resourceInputs["newAddressPrefix"] = state ? state.newAddressPrefix : undefined;
resourceInputs["newPort"] = state ? state.newPort : undefined;
resourceInputs["nodeNumber"] = state ? state.nodeNumber : undefined;
resourceInputs["paramValues"] = state ? state.paramValues : undefined;
resourceInputs["password"] = state ? state.password : undefined;
resourceInputs["port"] = state ? state.port : undefined;
resourceInputs["projectName"] = state ? state.projectName : undefined;
resourceInputs["purchaseMonths"] = state ? state.purchaseMonths : undefined;
resourceInputs["shardCapacity"] = state ? state.shardCapacity : undefined;
resourceInputs["shardNumber"] = state ? state.shardNumber : undefined;
resourceInputs["shardedCluster"] = state ? state.shardedCluster : undefined;
resourceInputs["subnetId"] = state ? state.subnetId : undefined;
resourceInputs["tags"] = state ? state.tags : undefined;
resourceInputs["timeScope"] = state ? state.timeScope : undefined;
resourceInputs["upgradeRegionDomain"] = state ? state.upgradeRegionDomain : undefined;
resourceInputs["vpcAuthMode"] = state ? state.vpcAuthMode : undefined;
resourceInputs["zoneIds"] = state ? state.zoneIds : undefined;
}
else {
const args = argsOrState;
if ((!args || args.engineVersion === undefined) && !opts.urn) {
throw new Error("Missing required property 'engineVersion'");
}
if ((!args || args.nodeNumber === undefined) && !opts.urn) {
throw new Error("Missing required property 'nodeNumber'");
}
if ((!args || args.shardCapacity === undefined) && !opts.urn) {
throw new Error("Missing required property 'shardCapacity'");
}
if ((!args || args.shardedCluster === undefined) && !opts.urn) {
throw new Error("Missing required property 'shardedCluster'");
}
if ((!args || args.subnetId === undefined) && !opts.urn) {
throw new Error("Missing required property 'subnetId'");
}
resourceInputs["additionalBandwidth"] = args ? args.additionalBandwidth : undefined;
resourceInputs["addrType"] = args ? args.addrType : undefined;
resourceInputs["applyImmediately"] = args ? args.applyImmediately : undefined;
resourceInputs["autoRenew"] = args ? args.autoRenew : undefined;
resourceInputs["backupActive"] = args ? args.backupActive : undefined;
resourceInputs["backupHour"] = args ? args.backupHour : undefined;
resourceInputs["backupPeriods"] = args ? args.backupPeriods : undefined;
resourceInputs["backupPointName"] = args ? args.backupPointName : undefined;
resourceInputs["chargeType"] = args ? args.chargeType : undefined;
resourceInputs["configureNodes"] = args ? args.configureNodes : undefined;
resourceInputs["createBackup"] = args ? args.createBackup : undefined;
resourceInputs["deletionProtection"] = args ? args.deletionProtection : undefined;
resourceInputs["engineVersion"] = args ? args.engineVersion : undefined;
resourceInputs["instanceName"] = args ? args.instanceName : undefined;
resourceInputs["maxConnections"] = args ? args.maxConnections : undefined;
resourceInputs["multiAz"] = args ? args.multiAz : undefined;
resourceInputs["newAddressPrefix"] = args ? args.newAddressPrefix : undefined;
resourceInputs["newPort"] = args ? args.newPort : undefined;
resourceInputs["nodeNumber"] = args ? args.nodeNumber : undefined;
resourceInputs["paramValues"] = args ? args.paramValues : undefined;
resourceInputs["password"] = (args === null || args === void 0 ? void 0 : args.password) ? pulumi.secret(args.password) : undefined;
resourceInputs["port"] = args ? args.port : undefined;
resourceInputs["projectName"] = args ? args.projectName : undefined;
resourceInputs["purchaseMonths"] = args ? args.purchaseMonths : undefined;
resourceInputs["shardCapacity"] = args ? args.shardCapacity : undefined;
resourceInputs["shardNumber"] = args ? args.shardNumber : undefined;
resourceInputs["shardedCluster"] = args ? args.shardedCluster : undefined;
resourceInputs["subnetId"] = args ? args.subnetId : undefined;
resourceInputs["tags"] = args ? args.tags : undefined;
resourceInputs["timeScope"] = args ? args.timeScope : undefined;
resourceInputs["upgradeRegionDomain"] = args ? args.upgradeRegionDomain : undefined;
resourceInputs["vpcAuthMode"] = args ? args.vpcAuthMode : undefined;
resourceInputs["zoneIds"] = args ? args.zoneIds : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["password"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(Instance.__pulumiType, name, resourceInputs, opts);
}
}
exports.Instance = Instance;
/** @internal */
Instance.__pulumiType = 'volcengine:redis/instance:Instance';
//# sourceMappingURL=instance.js.map