@volcengine/pulumi
Version:
A Pulumi package for creating and managing volcengine cloud resources.
172 lines • 8.51 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");
/**
* Provides a resource to manage rabbitmq 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.rabbitmq.Instance("fooInstance", {
* zoneIds: [
* fooZones.then(fooZones => fooZones.zones?.[0]?.id),
* fooZones.then(fooZones => fooZones.zones?.[1]?.id),
* fooZones.then(fooZones => fooZones.zones?.[2]?.id),
* ],
* subnetId: fooSubnet.id,
* version: "3.8.18",
* userName: "acc-test-user",
* userPassword: "93f0cb0614Aab12",
* computeSpec: "rabbitmq.n3.x2.small",
* storageSpace: 300,
* instanceName: "acc-test-rabbitmq",
* instanceDescription: "acc-test",
* chargeInfo: {
* chargeType: "PostPaid",
* },
* projectName: "default",
* tags: [{
* key: "k1",
* value: "v1",
* }],
* });
* ```
*
* ## Import
*
* RabbitmqInstance can be imported using the id, e.g.
*
* ```sh
* $ pulumi import volcengine:rabbitmq/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["accountId"] = state ? state.accountId : undefined;
resourceInputs["applyPrivateDnsToPublic"] = state ? state.applyPrivateDnsToPublic : undefined;
resourceInputs["archType"] = state ? state.archType : undefined;
resourceInputs["chargeInfo"] = state ? state.chargeInfo : undefined;
resourceInputs["computeSpec"] = state ? state.computeSpec : undefined;
resourceInputs["createTime"] = state ? state.createTime : undefined;
resourceInputs["eipId"] = state ? state.eipId : undefined;
resourceInputs["endpoints"] = state ? state.endpoints : undefined;
resourceInputs["initUserName"] = state ? state.initUserName : undefined;
resourceInputs["instanceDescription"] = state ? state.instanceDescription : undefined;
resourceInputs["instanceName"] = state ? state.instanceName : undefined;
resourceInputs["instanceStatus"] = state ? state.instanceStatus : undefined;
resourceInputs["projectName"] = state ? state.projectName : undefined;
resourceInputs["regionId"] = state ? state.regionId : undefined;
resourceInputs["storageSpace"] = state ? state.storageSpace : undefined;
resourceInputs["subnetId"] = state ? state.subnetId : undefined;
resourceInputs["tags"] = state ? state.tags : undefined;
resourceInputs["usedStorageSpace"] = state ? state.usedStorageSpace : undefined;
resourceInputs["userName"] = state ? state.userName : undefined;
resourceInputs["userPassword"] = state ? state.userPassword : undefined;
resourceInputs["version"] = state ? state.version : undefined;
resourceInputs["vpcId"] = state ? state.vpcId : undefined;
resourceInputs["zoneIds"] = state ? state.zoneIds : undefined;
}
else {
const args = argsOrState;
if ((!args || args.chargeInfo === undefined) && !opts.urn) {
throw new Error("Missing required property 'chargeInfo'");
}
if ((!args || args.computeSpec === undefined) && !opts.urn) {
throw new Error("Missing required property 'computeSpec'");
}
if ((!args || args.storageSpace === undefined) && !opts.urn) {
throw new Error("Missing required property 'storageSpace'");
}
if ((!args || args.subnetId === undefined) && !opts.urn) {
throw new Error("Missing required property 'subnetId'");
}
if ((!args || args.userName === undefined) && !opts.urn) {
throw new Error("Missing required property 'userName'");
}
if ((!args || args.userPassword === undefined) && !opts.urn) {
throw new Error("Missing required property 'userPassword'");
}
if ((!args || args.version === undefined) && !opts.urn) {
throw new Error("Missing required property 'version'");
}
if ((!args || args.zoneIds === undefined) && !opts.urn) {
throw new Error("Missing required property 'zoneIds'");
}
resourceInputs["chargeInfo"] = args ? args.chargeInfo : undefined;
resourceInputs["computeSpec"] = args ? args.computeSpec : undefined;
resourceInputs["instanceDescription"] = args ? args.instanceDescription : undefined;
resourceInputs["instanceName"] = args ? args.instanceName : undefined;
resourceInputs["projectName"] = args ? args.projectName : undefined;
resourceInputs["storageSpace"] = args ? args.storageSpace : undefined;
resourceInputs["subnetId"] = args ? args.subnetId : undefined;
resourceInputs["tags"] = args ? args.tags : undefined;
resourceInputs["userName"] = args ? args.userName : undefined;
resourceInputs["userPassword"] = (args === null || args === void 0 ? void 0 : args.userPassword) ? pulumi.secret(args.userPassword) : undefined;
resourceInputs["version"] = args ? args.version : undefined;
resourceInputs["zoneIds"] = args ? args.zoneIds : undefined;
resourceInputs["accountId"] = undefined /*out*/;
resourceInputs["applyPrivateDnsToPublic"] = undefined /*out*/;
resourceInputs["archType"] = undefined /*out*/;
resourceInputs["createTime"] = undefined /*out*/;
resourceInputs["eipId"] = undefined /*out*/;
resourceInputs["endpoints"] = undefined /*out*/;
resourceInputs["initUserName"] = undefined /*out*/;
resourceInputs["instanceStatus"] = undefined /*out*/;
resourceInputs["regionId"] = undefined /*out*/;
resourceInputs["usedStorageSpace"] = undefined /*out*/;
resourceInputs["vpcId"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["userPassword"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(Instance.__pulumiType, name, resourceInputs, opts);
}
}
exports.Instance = Instance;
/** @internal */
Instance.__pulumiType = 'volcengine:rabbitmq/instance:Instance';
//# sourceMappingURL=instance.js.map