@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
133 lines • 5.94 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");
/**
* Manages a FSx for Lustre Data Repository Association. See [Linking your file system to an S3 bucket](https://docs.aws.amazon.com/fsx/latest/LustreGuide/create-dra-linked-data-repo.html) for more information.
*
* > **NOTE:** Data Repository Associations are only compatible with AWS FSx for Lustre File Systems and `PERSISTENT_2` deployment type.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.s3.Bucket("example", {bucket: "my-bucket"});
* const exampleBucketAcl = new aws.s3.BucketAcl("example", {
* bucket: example.id,
* acl: "private",
* });
* const exampleLustreFileSystem = new aws.fsx.LustreFileSystem("example", {
* storageCapacity: 1200,
* subnetIds: exampleAwsSubnet.id,
* deploymentType: "PERSISTENT_2",
* perUnitStorageThroughput: 125,
* });
* const exampleDataRepositoryAssociation = new aws.fsx.DataRepositoryAssociation("example", {
* fileSystemId: exampleLustreFileSystem.id,
* dataRepositoryPath: pulumi.interpolate`s3://${example.id}`,
* fileSystemPath: "/my-bucket",
* s3: {
* autoExportPolicy: {
* events: [
* "NEW",
* "CHANGED",
* "DELETED",
* ],
* },
* autoImportPolicy: {
* events: [
* "NEW",
* "CHANGED",
* "DELETED",
* ],
* },
* },
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import FSx Data Repository Associations using the `id`. For example:
*
* ```sh
* $ pulumi import aws:fsx/dataRepositoryAssociation:DataRepositoryAssociation example dra-0b1cfaeca11088b10
* ```
*/
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 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 DataRepositoryAssociation(name, state, { ...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;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["arn"] = state?.arn;
resourceInputs["associationId"] = state?.associationId;
resourceInputs["batchImportMetaDataOnCreate"] = state?.batchImportMetaDataOnCreate;
resourceInputs["dataRepositoryPath"] = state?.dataRepositoryPath;
resourceInputs["deleteDataInFilesystem"] = state?.deleteDataInFilesystem;
resourceInputs["fileSystemId"] = state?.fileSystemId;
resourceInputs["fileSystemPath"] = state?.fileSystemPath;
resourceInputs["importedFileChunkSize"] = state?.importedFileChunkSize;
resourceInputs["region"] = state?.region;
resourceInputs["s3"] = state?.s3;
resourceInputs["tags"] = state?.tags;
resourceInputs["tagsAll"] = state?.tagsAll;
}
else {
const args = argsOrState;
if (args?.dataRepositoryPath === undefined && !opts.urn) {
throw new Error("Missing required property 'dataRepositoryPath'");
}
if (args?.fileSystemId === undefined && !opts.urn) {
throw new Error("Missing required property 'fileSystemId'");
}
if (args?.fileSystemPath === undefined && !opts.urn) {
throw new Error("Missing required property 'fileSystemPath'");
}
resourceInputs["batchImportMetaDataOnCreate"] = args?.batchImportMetaDataOnCreate;
resourceInputs["dataRepositoryPath"] = args?.dataRepositoryPath;
resourceInputs["deleteDataInFilesystem"] = args?.deleteDataInFilesystem;
resourceInputs["fileSystemId"] = args?.fileSystemId;
resourceInputs["fileSystemPath"] = args?.fileSystemPath;
resourceInputs["importedFileChunkSize"] = args?.importedFileChunkSize;
resourceInputs["region"] = args?.region;
resourceInputs["s3"] = args?.s3;
resourceInputs["tags"] = args?.tags;
resourceInputs["arn"] = undefined /*out*/;
resourceInputs["associationId"] = undefined /*out*/;
resourceInputs["tagsAll"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(DataRepositoryAssociation.__pulumiType, name, resourceInputs, opts);
}
}
exports.DataRepositoryAssociation = DataRepositoryAssociation;
/** @internal */
DataRepositoryAssociation.__pulumiType = 'aws:fsx/dataRepositoryAssociation:DataRepositoryAssociation';
//# sourceMappingURL=dataRepositoryAssociation.js.map