UNPKG

@pulumi/aws

Version:

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

158 lines 7.56 kB
"use strict"; // *** 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.CachesIscsiVolume = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages an AWS Storage Gateway cached iSCSI volume. * * > **NOTE:** The gateway must have cache added (e.g., via the `aws.storagegateway.Cache` resource) before creating volumes otherwise the Storage Gateway API will return an error. * * > **NOTE:** The gateway must have an upload buffer added (e.g., via the `aws.storagegateway.UploadBuffer` resource) before the volume is operational to clients, however the Storage Gateway API will allow volume creation without error in that case and return volume status as `UPLOAD BUFFER NOT CONFIGURED`. * * ## Example Usage * * > **NOTE:** These examples are referencing the `aws.storagegateway.Cache` resource `gatewayArn` attribute to ensure this provider properly adds cache before creating the volume. If you are not using this method, you may need to declare an expicit dependency (e.g. via `dependsOn = [aws_storagegateway_cache.example]`) to ensure proper ordering. * * ### Create Empty Cached iSCSI Volume * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.storagegateway.CachesIscsiVolume("example", { * gatewayArn: exampleAwsStoragegatewayCache.gatewayArn, * networkInterfaceId: exampleAwsInstance.privateIp, * targetName: "example", * volumeSizeInBytes: 5368709120, * }); * ``` * * ### Create Cached iSCSI Volume From Snapshot * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.storagegateway.CachesIscsiVolume("example", { * gatewayArn: exampleAwsStoragegatewayCache.gatewayArn, * networkInterfaceId: exampleAwsInstance.privateIp, * snapshotId: exampleAwsEbsSnapshot.id, * targetName: "example", * volumeSizeInBytes: exampleAwsEbsSnapshot.volumeSize * 1024 * 1024 * 1024, * }); * ``` * * ### Create Cached iSCSI Volume From Source Volume * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.storagegateway.CachesIscsiVolume("example", { * gatewayArn: exampleAwsStoragegatewayCache.gatewayArn, * networkInterfaceId: exampleAwsInstance.privateIp, * sourceVolumeArn: existing.arn, * targetName: "example", * volumeSizeInBytes: existing.volumeSizeInBytes, * }); * ``` * * ## Import * * Using `pulumi import`, import `aws_storagegateway_cached_iscsi_volume` using the volume Amazon Resource Name (ARN). For example: * * ```sh * $ pulumi import aws:storagegateway/cachesIscsiVolume:CachesIscsiVolume example arn:aws:storagegateway:us-east-1:123456789012:gateway/sgw-12345678/volume/vol-12345678 * ``` */ class CachesIscsiVolume extends pulumi.CustomResource { /** * Get an existing CachesIscsiVolume 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 CachesIscsiVolume(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of CachesIscsiVolume. 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'] === CachesIscsiVolume.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["arn"] = state?.arn; resourceInputs["chapEnabled"] = state?.chapEnabled; resourceInputs["gatewayArn"] = state?.gatewayArn; resourceInputs["kmsEncrypted"] = state?.kmsEncrypted; resourceInputs["kmsKey"] = state?.kmsKey; resourceInputs["lunNumber"] = state?.lunNumber; resourceInputs["networkInterfaceId"] = state?.networkInterfaceId; resourceInputs["networkInterfacePort"] = state?.networkInterfacePort; resourceInputs["region"] = state?.region; resourceInputs["snapshotId"] = state?.snapshotId; resourceInputs["sourceVolumeArn"] = state?.sourceVolumeArn; resourceInputs["tags"] = state?.tags; resourceInputs["tagsAll"] = state?.tagsAll; resourceInputs["targetArn"] = state?.targetArn; resourceInputs["targetName"] = state?.targetName; resourceInputs["volumeArn"] = state?.volumeArn; resourceInputs["volumeId"] = state?.volumeId; resourceInputs["volumeSizeInBytes"] = state?.volumeSizeInBytes; } else { const args = argsOrState; if (args?.gatewayArn === undefined && !opts.urn) { throw new Error("Missing required property 'gatewayArn'"); } if (args?.networkInterfaceId === undefined && !opts.urn) { throw new Error("Missing required property 'networkInterfaceId'"); } if (args?.targetName === undefined && !opts.urn) { throw new Error("Missing required property 'targetName'"); } if (args?.volumeSizeInBytes === undefined && !opts.urn) { throw new Error("Missing required property 'volumeSizeInBytes'"); } resourceInputs["gatewayArn"] = args?.gatewayArn; resourceInputs["kmsEncrypted"] = args?.kmsEncrypted; resourceInputs["kmsKey"] = args?.kmsKey; resourceInputs["networkInterfaceId"] = args?.networkInterfaceId; resourceInputs["region"] = args?.region; resourceInputs["snapshotId"] = args?.snapshotId; resourceInputs["sourceVolumeArn"] = args?.sourceVolumeArn; resourceInputs["tags"] = args?.tags; resourceInputs["targetName"] = args?.targetName; resourceInputs["volumeSizeInBytes"] = args?.volumeSizeInBytes; resourceInputs["arn"] = undefined /*out*/; resourceInputs["chapEnabled"] = undefined /*out*/; resourceInputs["lunNumber"] = undefined /*out*/; resourceInputs["networkInterfacePort"] = undefined /*out*/; resourceInputs["tagsAll"] = undefined /*out*/; resourceInputs["targetArn"] = undefined /*out*/; resourceInputs["volumeArn"] = undefined /*out*/; resourceInputs["volumeId"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(CachesIscsiVolume.__pulumiType, name, resourceInputs, opts); } } exports.CachesIscsiVolume = CachesIscsiVolume; /** @internal */ CachesIscsiVolume.__pulumiType = 'aws:storagegateway/cachesIscsiVolume:CachesIscsiVolume'; //# sourceMappingURL=cachesIscsiVolume.js.map