@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
106 lines • 4.22 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.Disk_attachment = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages a Lightsail disk attachment. Use this resource to attach additional storage disks to your Lightsail instances for expanded storage capacity.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const available = aws.getAvailabilityZones({
* state: "available",
* filters: [{
* name: "opt-in-status",
* values: ["opt-in-not-required"],
* }],
* });
* const example = new aws.lightsail.Disk("example", {
* name: "example-disk",
* sizeInGb: 8,
* availabilityZone: available.then(available => available.names?.[0]),
* });
* const exampleInstance = new aws.lightsail.Instance("example", {
* name: "example-instance",
* availabilityZone: available.then(available => available.names?.[0]),
* blueprintId: "amazon_linux_2",
* bundleId: "nano_3_0",
* });
* const exampleDisk_attachment = new aws.lightsail.Disk_attachment("example", {
* diskName: example.name,
* instanceName: exampleInstance.name,
* diskPath: "/dev/xvdf",
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import `aws_lightsail_disk_attachment` using the id attribute. For example:
*
* ```sh
* $ pulumi import aws:lightsail/disk_attachment:Disk_attachment example example-disk,example-instance
* ```
*/
class Disk_attachment extends pulumi.CustomResource {
/**
* Get an existing Disk_attachment 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 Disk_attachment(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of Disk_attachment. 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'] === Disk_attachment.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["diskName"] = state?.diskName;
resourceInputs["diskPath"] = state?.diskPath;
resourceInputs["instanceName"] = state?.instanceName;
resourceInputs["region"] = state?.region;
}
else {
const args = argsOrState;
if (args?.diskName === undefined && !opts.urn) {
throw new Error("Missing required property 'diskName'");
}
if (args?.diskPath === undefined && !opts.urn) {
throw new Error("Missing required property 'diskPath'");
}
if (args?.instanceName === undefined && !opts.urn) {
throw new Error("Missing required property 'instanceName'");
}
resourceInputs["diskName"] = args?.diskName;
resourceInputs["diskPath"] = args?.diskPath;
resourceInputs["instanceName"] = args?.instanceName;
resourceInputs["region"] = args?.region;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Disk_attachment.__pulumiType, name, resourceInputs, opts);
}
}
exports.Disk_attachment = Disk_attachment;
/** @internal */
Disk_attachment.__pulumiType = 'aws:lightsail/disk_attachment:Disk_attachment';
//# sourceMappingURL=disk_attachment.js.map