@ediri/vultr
Version:
A Pulumi package for creating and managing Vultr cloud resources.
99 lines • 4.35 kB
JavaScript
;
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.BlockStorage = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Provides a Vultr Block Storage resource. This can be used to create, read, modify, and delete Block Storage.
*
* ## Example Usage
*
* Create a new Block Storage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as vultr from "@ediri/vultr";
*
* const myBlockstorage = new vultr.BlockStorage("myBlockstorage", {
* label: "vultr-block-storage",
* region: "ewr",
* sizeGb: 10,
* });
* ```
*
* ## Import
*
* Block Storage can be imported using the Block Storage `ID`, e.g.
*
* ```sh
* $ pulumi import vultr:index/blockStorage:BlockStorage my_blockstorage e315835e-d466-4e89-9b4c-dfd8788d7685
* ```
*/
class BlockStorage extends pulumi.CustomResource {
/**
* Get an existing BlockStorage 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 BlockStorage(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of BlockStorage. 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'] === BlockStorage.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["attachedToInstance"] = state ? state.attachedToInstance : undefined;
resourceInputs["blockType"] = state ? state.blockType : undefined;
resourceInputs["cost"] = state ? state.cost : undefined;
resourceInputs["dateCreated"] = state ? state.dateCreated : undefined;
resourceInputs["label"] = state ? state.label : undefined;
resourceInputs["live"] = state ? state.live : undefined;
resourceInputs["mountId"] = state ? state.mountId : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["sizeGb"] = state ? state.sizeGb : undefined;
resourceInputs["status"] = state ? state.status : undefined;
}
else {
const args = argsOrState;
if ((!args || args.region === undefined) && !opts.urn) {
throw new Error("Missing required property 'region'");
}
if ((!args || args.sizeGb === undefined) && !opts.urn) {
throw new Error("Missing required property 'sizeGb'");
}
resourceInputs["attachedToInstance"] = args ? args.attachedToInstance : undefined;
resourceInputs["blockType"] = args ? args.blockType : undefined;
resourceInputs["label"] = args ? args.label : undefined;
resourceInputs["live"] = args ? args.live : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["sizeGb"] = args ? args.sizeGb : undefined;
resourceInputs["cost"] = undefined /*out*/;
resourceInputs["dateCreated"] = undefined /*out*/;
resourceInputs["mountId"] = undefined /*out*/;
resourceInputs["status"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(BlockStorage.__pulumiType, name, resourceInputs, opts);
}
}
exports.BlockStorage = BlockStorage;
/** @internal */
BlockStorage.__pulumiType = 'vultr:index/blockStorage:BlockStorage';
//# sourceMappingURL=blockStorage.js.map