@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
219 lines • 9.69 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.Gateway = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages an AWS Storage Gateway file, tape, or volume gateway in the provider region.
*
* > **NOTE:** The Storage Gateway API requires the gateway to be connected to properly return information after activation. If you are receiving `The specified gateway is not connected` errors during resource creation (gateway activation), ensure your gateway instance meets the [Storage Gateway requirements](https://docs.aws.amazon.com/storagegateway/latest/userguide/Requirements.html).
*
* ## Example Usage
*
* ### Local Cache
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const testVolumeAttachment = new aws.ec2.VolumeAttachment("test", {
* deviceName: "/dev/xvdb",
* volumeId: testAwsEbsVolume.id,
* instanceId: testAwsInstance.id,
* });
* const test = aws.storagegateway.getLocalDisk({
* diskNode: testAwsVolumeAttachment.deviceName,
* gatewayArn: testAwsStoragegatewayGateway.arn,
* });
* const testCache = new aws.storagegateway.Cache("test", {
* diskId: test.then(test => test.diskId),
* gatewayArn: testAwsStoragegatewayGateway.arn,
* });
* ```
*
* ### FSx File Gateway
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.storagegateway.Gateway("example", {
* gatewayIpAddress: "1.2.3.4",
* gatewayName: "example",
* gatewayTimezone: "GMT",
* gatewayType: "FILE_FSX_SMB",
* smbActiveDirectorySettings: {
* domainName: "corp.example.com",
* password: "avoid-plaintext-passwords",
* username: "Admin",
* },
* });
* ```
*
* ### S3 File Gateway
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.storagegateway.Gateway("example", {
* gatewayIpAddress: "1.2.3.4",
* gatewayName: "example",
* gatewayTimezone: "GMT",
* gatewayType: "FILE_S3",
* });
* ```
*
* ### Tape Gateway
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.storagegateway.Gateway("example", {
* gatewayIpAddress: "1.2.3.4",
* gatewayName: "example",
* gatewayTimezone: "GMT",
* gatewayType: "VTL",
* mediumChangerType: "AWS-Gateway-VTL",
* tapeDriveType: "IBM-ULT3580-TD5",
* });
* ```
*
* ### Volume Gateway (Cached)
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.storagegateway.Gateway("example", {
* gatewayIpAddress: "1.2.3.4",
* gatewayName: "example",
* gatewayTimezone: "GMT",
* gatewayType: "CACHED",
* });
* ```
*
* ### Volume Gateway (Stored)
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.storagegateway.Gateway("example", {
* gatewayIpAddress: "1.2.3.4",
* gatewayName: "example",
* gatewayTimezone: "GMT",
* gatewayType: "STORED",
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import `aws_storagegateway_gateway` using the gateway Amazon Resource Name (ARN). For example:
*
* ```sh
* $ pulumi import aws:storagegateway/gateway:Gateway example arn:aws:storagegateway:us-east-1:123456789012:gateway/sgw-12345678
* ```
* Certain resource arguments, like `gateway_ip_address` do not have a Storage Gateway API method for reading the information after creation, either omit the argument from the Pulumi program or use `ignore_changes` to hide the difference. For example:
*/
class Gateway extends pulumi.CustomResource {
/**
* Get an existing Gateway 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 Gateway(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of Gateway. 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'] === Gateway.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["activationKey"] = state?.activationKey;
resourceInputs["arn"] = state?.arn;
resourceInputs["averageDownloadRateLimitInBitsPerSec"] = state?.averageDownloadRateLimitInBitsPerSec;
resourceInputs["averageUploadRateLimitInBitsPerSec"] = state?.averageUploadRateLimitInBitsPerSec;
resourceInputs["cloudwatchLogGroupArn"] = state?.cloudwatchLogGroupArn;
resourceInputs["ec2InstanceId"] = state?.ec2InstanceId;
resourceInputs["endpointType"] = state?.endpointType;
resourceInputs["gatewayId"] = state?.gatewayId;
resourceInputs["gatewayIpAddress"] = state?.gatewayIpAddress;
resourceInputs["gatewayName"] = state?.gatewayName;
resourceInputs["gatewayNetworkInterfaces"] = state?.gatewayNetworkInterfaces;
resourceInputs["gatewayTimezone"] = state?.gatewayTimezone;
resourceInputs["gatewayType"] = state?.gatewayType;
resourceInputs["gatewayVpcEndpoint"] = state?.gatewayVpcEndpoint;
resourceInputs["hostEnvironment"] = state?.hostEnvironment;
resourceInputs["maintenanceStartTime"] = state?.maintenanceStartTime;
resourceInputs["mediumChangerType"] = state?.mediumChangerType;
resourceInputs["region"] = state?.region;
resourceInputs["smbActiveDirectorySettings"] = state?.smbActiveDirectorySettings;
resourceInputs["smbFileShareVisibility"] = state?.smbFileShareVisibility;
resourceInputs["smbGuestPassword"] = state?.smbGuestPassword;
resourceInputs["smbSecurityStrategy"] = state?.smbSecurityStrategy;
resourceInputs["tags"] = state?.tags;
resourceInputs["tagsAll"] = state?.tagsAll;
resourceInputs["tapeDriveType"] = state?.tapeDriveType;
}
else {
const args = argsOrState;
if (args?.gatewayName === undefined && !opts.urn) {
throw new Error("Missing required property 'gatewayName'");
}
if (args?.gatewayTimezone === undefined && !opts.urn) {
throw new Error("Missing required property 'gatewayTimezone'");
}
resourceInputs["activationKey"] = args?.activationKey;
resourceInputs["averageDownloadRateLimitInBitsPerSec"] = args?.averageDownloadRateLimitInBitsPerSec;
resourceInputs["averageUploadRateLimitInBitsPerSec"] = args?.averageUploadRateLimitInBitsPerSec;
resourceInputs["cloudwatchLogGroupArn"] = args?.cloudwatchLogGroupArn;
resourceInputs["gatewayIpAddress"] = args?.gatewayIpAddress;
resourceInputs["gatewayName"] = args?.gatewayName;
resourceInputs["gatewayTimezone"] = args?.gatewayTimezone;
resourceInputs["gatewayType"] = args?.gatewayType;
resourceInputs["gatewayVpcEndpoint"] = args?.gatewayVpcEndpoint;
resourceInputs["maintenanceStartTime"] = args?.maintenanceStartTime;
resourceInputs["mediumChangerType"] = args?.mediumChangerType;
resourceInputs["region"] = args?.region;
resourceInputs["smbActiveDirectorySettings"] = args?.smbActiveDirectorySettings;
resourceInputs["smbFileShareVisibility"] = args?.smbFileShareVisibility;
resourceInputs["smbGuestPassword"] = args?.smbGuestPassword ? pulumi.secret(args.smbGuestPassword) : undefined;
resourceInputs["smbSecurityStrategy"] = args?.smbSecurityStrategy;
resourceInputs["tags"] = args?.tags;
resourceInputs["tapeDriveType"] = args?.tapeDriveType;
resourceInputs["arn"] = undefined /*out*/;
resourceInputs["ec2InstanceId"] = undefined /*out*/;
resourceInputs["endpointType"] = undefined /*out*/;
resourceInputs["gatewayId"] = undefined /*out*/;
resourceInputs["gatewayNetworkInterfaces"] = undefined /*out*/;
resourceInputs["hostEnvironment"] = undefined /*out*/;
resourceInputs["tagsAll"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["smbGuestPassword"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(Gateway.__pulumiType, name, resourceInputs, opts);
}
}
exports.Gateway = Gateway;
/** @internal */
Gateway.__pulumiType = 'aws:storagegateway/gateway:Gateway';
//# sourceMappingURL=gateway.js.map