@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
110 lines • 5.19 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.Volume = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages a single EBS volume.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.ebs.Volume("example", {
* availabilityZone: "us-west-2a",
* size: 40,
* tags: {
* Name: "HelloWorld",
* },
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import EBS Volumes using the `id`. For example:
*
* ```sh
* $ pulumi import aws:ebs/volume:Volume id vol-049df61146c4d7901
* ```
*/
class Volume extends pulumi.CustomResource {
/**
* Get an existing Volume 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 Volume(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of Volume. 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'] === Volume.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["arn"] = state ? state.arn : undefined;
resourceInputs["availabilityZone"] = state ? state.availabilityZone : undefined;
resourceInputs["createTime"] = state ? state.createTime : undefined;
resourceInputs["encrypted"] = state ? state.encrypted : undefined;
resourceInputs["finalSnapshot"] = state ? state.finalSnapshot : undefined;
resourceInputs["iops"] = state ? state.iops : undefined;
resourceInputs["kmsKeyId"] = state ? state.kmsKeyId : undefined;
resourceInputs["multiAttachEnabled"] = state ? state.multiAttachEnabled : undefined;
resourceInputs["outpostArn"] = state ? state.outpostArn : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["size"] = state ? state.size : undefined;
resourceInputs["snapshotId"] = state ? state.snapshotId : undefined;
resourceInputs["tags"] = state ? state.tags : undefined;
resourceInputs["tagsAll"] = state ? state.tagsAll : undefined;
resourceInputs["throughput"] = state ? state.throughput : undefined;
resourceInputs["type"] = state ? state.type : undefined;
resourceInputs["volumeInitializationRate"] = state ? state.volumeInitializationRate : undefined;
}
else {
const args = argsOrState;
if ((!args || args.availabilityZone === undefined) && !opts.urn) {
throw new Error("Missing required property 'availabilityZone'");
}
resourceInputs["availabilityZone"] = args ? args.availabilityZone : undefined;
resourceInputs["encrypted"] = args ? args.encrypted : undefined;
resourceInputs["finalSnapshot"] = args ? args.finalSnapshot : undefined;
resourceInputs["iops"] = args ? args.iops : undefined;
resourceInputs["kmsKeyId"] = args ? args.kmsKeyId : undefined;
resourceInputs["multiAttachEnabled"] = args ? args.multiAttachEnabled : undefined;
resourceInputs["outpostArn"] = args ? args.outpostArn : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["size"] = args ? args.size : undefined;
resourceInputs["snapshotId"] = args ? args.snapshotId : undefined;
resourceInputs["tags"] = args ? args.tags : undefined;
resourceInputs["throughput"] = args ? args.throughput : undefined;
resourceInputs["type"] = args ? args.type : undefined;
resourceInputs["volumeInitializationRate"] = args ? args.volumeInitializationRate : undefined;
resourceInputs["arn"] = undefined /*out*/;
resourceInputs["createTime"] = undefined /*out*/;
resourceInputs["tagsAll"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Volume.__pulumiType, name, resourceInputs, opts);
}
}
exports.Volume = Volume;
/** @internal */
Volume.__pulumiType = 'aws:ebs/volume:Volume';
//# sourceMappingURL=volume.js.map