@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
219 lines • 10.6 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, Object.assign(Object.assign({}, 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 ? state.activationKey : undefined;
resourceInputs["arn"] = state ? state.arn : undefined;
resourceInputs["averageDownloadRateLimitInBitsPerSec"] = state ? state.averageDownloadRateLimitInBitsPerSec : undefined;
resourceInputs["averageUploadRateLimitInBitsPerSec"] = state ? state.averageUploadRateLimitInBitsPerSec : undefined;
resourceInputs["cloudwatchLogGroupArn"] = state ? state.cloudwatchLogGroupArn : undefined;
resourceInputs["ec2InstanceId"] = state ? state.ec2InstanceId : undefined;
resourceInputs["endpointType"] = state ? state.endpointType : undefined;
resourceInputs["gatewayId"] = state ? state.gatewayId : undefined;
resourceInputs["gatewayIpAddress"] = state ? state.gatewayIpAddress : undefined;
resourceInputs["gatewayName"] = state ? state.gatewayName : undefined;
resourceInputs["gatewayNetworkInterfaces"] = state ? state.gatewayNetworkInterfaces : undefined;
resourceInputs["gatewayTimezone"] = state ? state.gatewayTimezone : undefined;
resourceInputs["gatewayType"] = state ? state.gatewayType : undefined;
resourceInputs["gatewayVpcEndpoint"] = state ? state.gatewayVpcEndpoint : undefined;
resourceInputs["hostEnvironment"] = state ? state.hostEnvironment : undefined;
resourceInputs["maintenanceStartTime"] = state ? state.maintenanceStartTime : undefined;
resourceInputs["mediumChangerType"] = state ? state.mediumChangerType : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["smbActiveDirectorySettings"] = state ? state.smbActiveDirectorySettings : undefined;
resourceInputs["smbFileShareVisibility"] = state ? state.smbFileShareVisibility : undefined;
resourceInputs["smbGuestPassword"] = state ? state.smbGuestPassword : undefined;
resourceInputs["smbSecurityStrategy"] = state ? state.smbSecurityStrategy : undefined;
resourceInputs["tags"] = state ? state.tags : undefined;
resourceInputs["tagsAll"] = state ? state.tagsAll : undefined;
resourceInputs["tapeDriveType"] = state ? state.tapeDriveType : undefined;
}
else {
const args = argsOrState;
if ((!args || args.gatewayName === undefined) && !opts.urn) {
throw new Error("Missing required property 'gatewayName'");
}
if ((!args || args.gatewayTimezone === undefined) && !opts.urn) {
throw new Error("Missing required property 'gatewayTimezone'");
}
resourceInputs["activationKey"] = args ? args.activationKey : undefined;
resourceInputs["averageDownloadRateLimitInBitsPerSec"] = args ? args.averageDownloadRateLimitInBitsPerSec : undefined;
resourceInputs["averageUploadRateLimitInBitsPerSec"] = args ? args.averageUploadRateLimitInBitsPerSec : undefined;
resourceInputs["cloudwatchLogGroupArn"] = args ? args.cloudwatchLogGroupArn : undefined;
resourceInputs["gatewayIpAddress"] = args ? args.gatewayIpAddress : undefined;
resourceInputs["gatewayName"] = args ? args.gatewayName : undefined;
resourceInputs["gatewayTimezone"] = args ? args.gatewayTimezone : undefined;
resourceInputs["gatewayType"] = args ? args.gatewayType : undefined;
resourceInputs["gatewayVpcEndpoint"] = args ? args.gatewayVpcEndpoint : undefined;
resourceInputs["maintenanceStartTime"] = args ? args.maintenanceStartTime : undefined;
resourceInputs["mediumChangerType"] = args ? args.mediumChangerType : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["smbActiveDirectorySettings"] = args ? args.smbActiveDirectorySettings : undefined;
resourceInputs["smbFileShareVisibility"] = args ? args.smbFileShareVisibility : undefined;
resourceInputs["smbGuestPassword"] = (args === null || args === void 0 ? void 0 : args.smbGuestPassword) ? pulumi.secret(args.smbGuestPassword) : undefined;
resourceInputs["smbSecurityStrategy"] = args ? args.smbSecurityStrategy : undefined;
resourceInputs["tags"] = args ? args.tags : undefined;
resourceInputs["tapeDriveType"] = args ? args.tapeDriveType : undefined;
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