@pulumi/aws-native
Version:
The Pulumi AWS Cloud Control Provider enables you to build, deploy, and manage [any AWS resource that's supported by the AWS Cloud Control API](https://github.com/pulumi/pulumi-aws-native/blob/master/provider/cmd/pulumi-gen-aws-native/supported-types.txt)
127 lines • 6.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.DataRepositoryAssociation = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Creates an Amazon FSx for Lustre data repository association (DRA). A data repository association is a link between a directory on the file system and an Amazon S3 bucket or prefix. You can have a maximum of 8 data repository associations on a file system. Data repository associations are supported on all FSx for Lustre 2.12 and newer file systems, excluding ``scratch_1`` deployment type.
* Each data repository association must have a unique Amazon FSx file system directory and a unique S3 bucket or prefix associated with it. You can configure a data repository association for automatic import only, for automatic export only, or for both. To learn more about linking a data repository to your file system, see [Linking your file system to an S3 bucket](https://docs.aws.amazon.com/fsx/latest/LustreGuide/create-dra-linked-data-repo.html).
*
* ## Example Usage
* ### Example
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws_native from "@pulumi/aws-native";
*
* const config = new pulumi.Config();
* const fsId = config.require("fsId");
* const draIdExportName = config.require("draIdExportName");
* const fileSystemPath = config.require("fileSystemPath");
* const importedFileChunkSize = config.require("importedFileChunkSize");
* const testDRA = new aws_native.fsx.DataRepositoryAssociation("testDRA", {
* fileSystemId: fsId,
* fileSystemPath: fileSystemPath,
* dataRepositoryPath: "s3://example-bucket",
* batchImportMetaDataOnCreate: true,
* importedFileChunkSize: importedFileChunkSize,
* s3: {
* autoImportPolicy: {
* events: [
* aws_native.fsx.DataRepositoryAssociationEventType.New,
* aws_native.fsx.DataRepositoryAssociationEventType.Changed,
* aws_native.fsx.DataRepositoryAssociationEventType.Deleted,
* ],
* },
* autoExportPolicy: {
* events: [
* aws_native.fsx.DataRepositoryAssociationEventType.New,
* aws_native.fsx.DataRepositoryAssociationEventType.Changed,
* aws_native.fsx.DataRepositoryAssociationEventType.Deleted,
* ],
* },
* },
* tags: [{
* key: "Location",
* value: "Boston",
* }],
* });
* export const draId = testDRA.id;
*
* ```
*/
class DataRepositoryAssociation extends pulumi.CustomResource {
/**
* Get an existing DataRepositoryAssociation 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 opts Optional settings to control the behavior of the CustomResource.
*/
static get(name, id, opts) {
return new DataRepositoryAssociation(name, undefined, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of DataRepositoryAssociation. 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'] === DataRepositoryAssociation.__pulumiType;
}
/**
* Create a DataRepositoryAssociation resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name, args, opts) {
let resourceInputs = {};
opts = opts || {};
if (!opts.id) {
if ((!args || args.dataRepositoryPath === undefined) && !opts.urn) {
throw new Error("Missing required property 'dataRepositoryPath'");
}
if ((!args || args.fileSystemId === undefined) && !opts.urn) {
throw new Error("Missing required property 'fileSystemId'");
}
if ((!args || args.fileSystemPath === undefined) && !opts.urn) {
throw new Error("Missing required property 'fileSystemPath'");
}
resourceInputs["batchImportMetaDataOnCreate"] = args ? args.batchImportMetaDataOnCreate : undefined;
resourceInputs["dataRepositoryPath"] = args ? args.dataRepositoryPath : undefined;
resourceInputs["fileSystemId"] = args ? args.fileSystemId : undefined;
resourceInputs["fileSystemPath"] = args ? args.fileSystemPath : undefined;
resourceInputs["importedFileChunkSize"] = args ? args.importedFileChunkSize : undefined;
resourceInputs["s3"] = args ? args.s3 : undefined;
resourceInputs["tags"] = args ? args.tags : undefined;
resourceInputs["associationId"] = undefined /*out*/;
resourceInputs["resourceArn"] = undefined /*out*/;
}
else {
resourceInputs["associationId"] = undefined /*out*/;
resourceInputs["batchImportMetaDataOnCreate"] = undefined /*out*/;
resourceInputs["dataRepositoryPath"] = undefined /*out*/;
resourceInputs["fileSystemId"] = undefined /*out*/;
resourceInputs["fileSystemPath"] = undefined /*out*/;
resourceInputs["importedFileChunkSize"] = undefined /*out*/;
resourceInputs["resourceArn"] = undefined /*out*/;
resourceInputs["s3"] = undefined /*out*/;
resourceInputs["tags"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const replaceOnChanges = { replaceOnChanges: ["batchImportMetaDataOnCreate", "dataRepositoryPath", "fileSystemId", "fileSystemPath"] };
opts = pulumi.mergeOptions(opts, replaceOnChanges);
super(DataRepositoryAssociation.__pulumiType, name, resourceInputs, opts);
}
}
exports.DataRepositoryAssociation = DataRepositoryAssociation;
/** @internal */
DataRepositoryAssociation.__pulumiType = 'aws-native:fsx:DataRepositoryAssociation';
//# sourceMappingURL=dataRepositoryAssociation.js.map