@pulumi/aws-native
Version:
The Pulumi AWS Cloud Control Provider enables you to build, deploy, and manage [any AWS resource that's supported by the AWS Cloud Control API](https://github.com/pulumi/pulumi-aws-native/blob/master/provider/cmd/pulumi-gen-aws-native/supported-types.txt)
102 lines • 5.86 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");
/**
* Specifies an Amazon Elastic Block Store (Amazon EBS) volume.
*
* When you use AWS CloudFormation to update an Amazon EBS volume that modifies `Iops` , `Size` , or `VolumeType` , there is a cooldown period before another operation can occur. This can cause your stack to report being in `UPDATE_IN_PROGRESS` or `UPDATE_ROLLBACK_IN_PROGRESS` for long periods of time.
*
* Amazon EBS does not support sizing down an Amazon EBS volume. AWS CloudFormation does not attempt to modify an Amazon EBS volume to a smaller size on rollback.
*
* Some common scenarios when you might encounter a cooldown period for Amazon EBS include:
*
* - You successfully update an Amazon EBS volume and the update succeeds. When you attempt another update within the cooldown window, that update will be subject to a cooldown period.
* - You successfully update an Amazon EBS volume and the update succeeds but another change in your `update-stack` call fails. The rollback will be subject to a cooldown period.
*
* For more information, see [Requirements for EBS volume modifications](https://docs.aws.amazon.com/ebs/latest/userguide/modify-volume-requirements.html) .
*
* *DeletionPolicy attribute*
*
* To control how AWS CloudFormation handles the volume when the stack is deleted, set a deletion policy for your volume. You can choose to retain the volume, to delete the volume, or to create a snapshot of the volume. For more information, see [DeletionPolicy attribute](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html) .
*
* > If you set a deletion policy that creates a snapshot, all tags on the volume are included in the snapshot.
*/
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 opts Optional settings to control the behavior of the CustomResource.
*/
static get(name, id, opts) {
return new Volume(name, undefined, 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;
}
/**
* Create a Volume resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name, args, opts) {
let resourceInputs = {};
opts = opts || {};
if (!opts.id) {
if ((!args || args.availabilityZone === undefined) && !opts.urn) {
throw new Error("Missing required property 'availabilityZone'");
}
resourceInputs["autoEnableIo"] = args ? args.autoEnableIo : undefined;
resourceInputs["availabilityZone"] = args ? args.availabilityZone : undefined;
resourceInputs["encrypted"] = args ? args.encrypted : 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["size"] = args ? args.size : undefined;
resourceInputs["snapshotId"] = args ? args.snapshotId : undefined;
resourceInputs["tags"] = args ? args.tags : undefined;
resourceInputs["throughput"] = args ? args.throughput : undefined;
resourceInputs["volumeInitializationRate"] = args ? args.volumeInitializationRate : undefined;
resourceInputs["volumeType"] = args ? args.volumeType : undefined;
resourceInputs["volumeId"] = undefined /*out*/;
}
else {
resourceInputs["autoEnableIo"] = undefined /*out*/;
resourceInputs["availabilityZone"] = undefined /*out*/;
resourceInputs["encrypted"] = undefined /*out*/;
resourceInputs["iops"] = undefined /*out*/;
resourceInputs["kmsKeyId"] = undefined /*out*/;
resourceInputs["multiAttachEnabled"] = undefined /*out*/;
resourceInputs["outpostArn"] = undefined /*out*/;
resourceInputs["size"] = undefined /*out*/;
resourceInputs["snapshotId"] = undefined /*out*/;
resourceInputs["tags"] = undefined /*out*/;
resourceInputs["throughput"] = undefined /*out*/;
resourceInputs["volumeId"] = undefined /*out*/;
resourceInputs["volumeInitializationRate"] = undefined /*out*/;
resourceInputs["volumeType"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Volume.__pulumiType, name, resourceInputs, opts);
}
}
exports.Volume = Volume;
/** @internal */
Volume.__pulumiType = 'aws-native:ec2:Volume';
//# sourceMappingURL=volume.js.map