UNPKG

@pulumi/aws

Version:

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

161 lines 7.13 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.FileSystemAssociation = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Associate an Amazon FSx file system with the FSx File Gateway. After the association process is complete, the file shares on the Amazon FSx file system are available for access through the gateway. This operation only supports the FSx File Gateway type. * * [FSx File Gateway requirements](https://docs.aws.amazon.com/filegateway/latest/filefsxw/Requirements.html). * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.storagegateway.FileSystemAssociation("example", { * gatewayArn: exampleAwsStoragegatewayGateway.arn, * locationArn: exampleAwsFsxWindowsFileSystem.arn, * username: "Admin", * password: "avoid-plaintext-passwords", * auditDestinationArn: exampleAwsS3Bucket.arn, * }); * ``` * * ## Required Services Example * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const awsServiceStoragegatewayAmiFILES3Latest = aws.ssm.getParameter({ * name: "/aws/service/storagegateway/ami/FILE_S3/latest", * }); * const test = new aws.ec2.Instance("test", { * ami: awsServiceStoragegatewayAmiFILES3Latest.then(awsServiceStoragegatewayAmiFILES3Latest => awsServiceStoragegatewayAmiFILES3Latest.value), * associatePublicIpAddress: true, * instanceType: aws.ec2.InstanceType[available.instanceType], * vpcSecurityGroupIds: [testAwsSecurityGroup.id], * subnetId: testAwsSubnet[0].id, * }, { * dependsOn: [ * testAwsRoute, * testAwsVpcDhcpOptionsAssociation, * ], * }); * const testGateway = new aws.storagegateway.Gateway("test", { * gatewayIpAddress: test.publicIp, * gatewayName: "test-sgw", * gatewayTimezone: "GMT", * gatewayType: "FILE_FSX_SMB", * smbActiveDirectorySettings: { * domainName: testAwsDirectoryServiceDirectory.name, * password: testAwsDirectoryServiceDirectory.password, * username: "Admin", * }, * }); * const testWindowsFileSystem = new aws.fsx.WindowsFileSystem("test", { * activeDirectoryId: testAwsDirectoryServiceDirectory.id, * securityGroupIds: [testAwsSecurityGroup.id], * skipFinalBackup: true, * storageCapacity: 32, * subnetIds: [testAwsSubnet[0].id], * throughputCapacity: 8, * }); * const fsx = new aws.storagegateway.FileSystemAssociation("fsx", { * gatewayArn: testGateway.arn, * locationArn: testWindowsFileSystem.arn, * username: "Admin", * password: testAwsDirectoryServiceDirectory.password, * cacheAttributes: { * cacheStaleTimeoutInSeconds: 400, * }, * auditDestinationArn: testAwsCloudwatchLogGroup.arn, * }); * ``` * * ## Import * * Using `pulumi import`, import `aws_storagegateway_file_system_association` using the FSx file system association Amazon Resource Name (ARN). For example: * * ```sh * $ pulumi import aws:storagegateway/fileSystemAssociation:FileSystemAssociation example arn:aws:storagegateway:us-east-1:123456789012:fs-association/fsa-0DA347732FDB40125 * ``` */ class FileSystemAssociation extends pulumi.CustomResource { /** * Get an existing FileSystemAssociation 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 FileSystemAssociation(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of FileSystemAssociation. 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'] === FileSystemAssociation.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["arn"] = state?.arn; resourceInputs["auditDestinationArn"] = state?.auditDestinationArn; resourceInputs["cacheAttributes"] = state?.cacheAttributes; resourceInputs["gatewayArn"] = state?.gatewayArn; resourceInputs["locationArn"] = state?.locationArn; resourceInputs["password"] = state?.password; resourceInputs["region"] = state?.region; resourceInputs["tags"] = state?.tags; resourceInputs["tagsAll"] = state?.tagsAll; resourceInputs["username"] = state?.username; } else { const args = argsOrState; if (args?.gatewayArn === undefined && !opts.urn) { throw new Error("Missing required property 'gatewayArn'"); } if (args?.locationArn === undefined && !opts.urn) { throw new Error("Missing required property 'locationArn'"); } if (args?.password === undefined && !opts.urn) { throw new Error("Missing required property 'password'"); } if (args?.username === undefined && !opts.urn) { throw new Error("Missing required property 'username'"); } resourceInputs["auditDestinationArn"] = args?.auditDestinationArn; resourceInputs["cacheAttributes"] = args?.cacheAttributes; resourceInputs["gatewayArn"] = args?.gatewayArn; resourceInputs["locationArn"] = args?.locationArn; resourceInputs["password"] = args?.password ? pulumi.secret(args.password) : undefined; resourceInputs["region"] = args?.region; resourceInputs["tags"] = args?.tags; resourceInputs["username"] = args?.username; resourceInputs["arn"] = undefined /*out*/; resourceInputs["tagsAll"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const secretOpts = { additionalSecretOutputs: ["password"] }; opts = pulumi.mergeOptions(opts, secretOpts); super(FileSystemAssociation.__pulumiType, name, resourceInputs, opts); } } exports.FileSystemAssociation = FileSystemAssociation; /** @internal */ FileSystemAssociation.__pulumiType = 'aws:storagegateway/fileSystemAssociation:FileSystemAssociation'; //# sourceMappingURL=fileSystemAssociation.js.map