DataRepositoryAssociation class

Manages a FSx for Lustre Data Repository Association. See Linking your file system to an S3 bucket for more information.

> NOTE: Data Repository Associations are only compatible with AWS FSx for Lustre File Systems and PERSISTENT_2 deployment type.

Example Usage

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", {
    s3: {
        autoExportPolicy: {
            events: [
                "NEW",
                "CHANGED",
                "DELETED",
            ],
        },
        autoImportPolicy: {
            events: [
                "NEW",
                "CHANGED",
                "DELETED",
            ],
        },
    },
    fileSystemId: exampleLustreFileSystem.id,
    dataRepositoryPath: pulumi.interpolate`s3://${example.id}`,
    fileSystemPath: "/my-bucket",
});
import pulumi
import pulumi_aws as aws

example = aws.s3.Bucket("example", bucket="my-bucket")
example_bucket_acl = aws.s3.BucketAcl("example",
    bucket=example.id,
    acl="private")
example_lustre_file_system = aws.fsx.LustreFileSystem("example",
    storage_capacity=1200,
    subnet_ids=example_aws_subnet["id"],
    deployment_type="PERSISTENT_2",
    per_unit_storage_throughput=125)
example_data_repository_association = aws.fsx.DataRepositoryAssociation("example",
    s3={
        "auto_export_policy": {
            "events": [
                "NEW",
                "CHANGED",
                "DELETED",
            ],
        },
        "auto_import_policy": {
            "events": [
                "NEW",
                "CHANGED",
                "DELETED",
            ],
        },
    },
    file_system_id=example_lustre_file_system.id,
    data_repository_path=example.id.apply(lambda id: f"s3://{id}"),
    file_system_path="/my-bucket")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() =>
{
    var example = new Aws.S3.Bucket("example", new()
    {
        BucketName = "my-bucket",
    });

    var exampleBucketAcl = new Aws.S3.BucketAcl("example", new()
    {
        Bucket = example.Id,
        Acl = "private",
    });

    var exampleLustreFileSystem = new Aws.Fsx.LustreFileSystem("example", new()
    {
        StorageCapacity = 1200,
        SubnetIds = exampleAwsSubnet.Id,
        DeploymentType = "PERSISTENT_2",
        PerUnitStorageThroughput = 125,
    });

    var exampleDataRepositoryAssociation = new Aws.Fsx.DataRepositoryAssociation("example", new()
    {
        S3 = new Aws.Fsx.Inputs.DataRepositoryAssociationS3Args
        {
            AutoExportPolicy = new Aws.Fsx.Inputs.DataRepositoryAssociationS3AutoExportPolicyArgs
            {
                Events = new[]
                {
                    "NEW",
                    "CHANGED",
                    "DELETED",
                },
            },
            AutoImportPolicy = new Aws.Fsx.Inputs.DataRepositoryAssociationS3AutoImportPolicyArgs
            {
                Events = new[]
                {
                    "NEW",
                    "CHANGED",
                    "DELETED",
                },
            },
        },
        FileSystemId = exampleLustreFileSystem.Id,
        DataRepositoryPath = example.Id.Apply(id => $"s3://{id}"),
        FileSystemPath = "/my-bucket",
    });

});
package main

import (
	"fmt"

	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/fsx"
	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/s3"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := s3.NewBucket(ctx, "example", &s3.BucketArgs{
			Bucket: pulumi.String("my-bucket"),
		})
		if err != nil {
			return err
		}
		_, err = s3.NewBucketAcl(ctx, "example", &s3.BucketAclArgs{
			Bucket: example.ID().ToIDOutput().ToStringOutput(),
			Acl:    pulumi.String("private"),
		})
		if err != nil {
			return err
		}
		exampleLustreFileSystem, err := fsx.NewLustreFileSystem(ctx, "example", &fsx.LustreFileSystemArgs{
			StorageCapacity:          pulumi.Int(1200),
			SubnetIds:                pulumi.Any(exampleAwsSubnet.Id),
			DeploymentType:           pulumi.String("PERSISTENT_2"),
			PerUnitStorageThroughput: pulumi.Int(125),
		})
		if err != nil {
			return err
		}
		_, err = fsx.NewDataRepositoryAssociation(ctx, "example", &fsx.DataRepositoryAssociationArgs{
			S3: &fsx.DataRepositoryAssociationS3Args{
				AutoExportPolicy: &fsx.DataRepositoryAssociationS3AutoExportPolicyArgs{
					Events: pulumi.StringArray{
						pulumi.String("NEW"),
						pulumi.String("CHANGED"),
						pulumi.String("DELETED"),
					},
				},
				AutoImportPolicy: &fsx.DataRepositoryAssociationS3AutoImportPolicyArgs{
					Events: pulumi.StringArray{
						pulumi.String("NEW"),
						pulumi.String("CHANGED"),
						pulumi.String("DELETED"),
					},
				},
			},
			FileSystemId: exampleLustreFileSystem.ID().ToIDOutput().ToStringOutput(),
			DataRepositoryPath: example.ID().ApplyT(func(id pulumi.ID) (string, error) {
				return fmt.Sprintf("s3://%v", id), nil
			}).(pulumi.StringOutput),
			FileSystemPath: pulumi.String("/my-bucket"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    aws = {
      source = "pulumi/aws"
    }
  }
}

resource "aws_s3_bucket" "example" {
  bucket = "my-bucket"
}
resource "aws_s3_bucketacl" "example" {
  bucket = aws_s3_bucket.example.id
  acl    = "private"
}
resource "aws_fsx_lustrefilesystem" "example" {
  storage_capacity            = 1200
  subnet_ids                  = exampleAwsSubnet.id
  deployment_type             = "PERSISTENT_2"
  per_unit_storage_throughput = 125
}
resource "aws_fsx_datarepositoryassociation" "example" {
  s3 = {
    auto_export_policy = {
      events = ["NEW", "CHANGED", "DELETED"]
    }
    auto_import_policy = {
      events = ["NEW", "CHANGED", "DELETED"]
    }
  }
  file_system_id       = aws_fsx_lustrefilesystem.example.id
  data_repository_path ="s3://${aws_s3_bucket.example.id}"
  file_system_path     = "/my-bucket"
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.s3.Bucket;
import com.pulumi.aws.s3.BucketArgs;
import com.pulumi.aws.s3.BucketAcl;
import com.pulumi.aws.s3.BucketAclArgs;
import com.pulumi.aws.fsx.LustreFileSystem;
import com.pulumi.aws.fsx.LustreFileSystemArgs;
import com.pulumi.aws.fsx.DataRepositoryAssociation;
import com.pulumi.aws.fsx.DataRepositoryAssociationArgs;
import com.pulumi.aws.fsx.inputs.DataRepositoryAssociationS3Args;
import com.pulumi.aws.fsx.inputs.DataRepositoryAssociationS3AutoExportPolicyArgs;
import com.pulumi.aws.fsx.inputs.DataRepositoryAssociationS3AutoImportPolicyArgs;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var example = new Bucket("example", BucketArgs.builder()
            .bucket("my-bucket")
            .build());

        var exampleBucketAcl = new BucketAcl("exampleBucketAcl", BucketAclArgs.builder()
            .bucket(example.id())
            .acl("private")
            .build());

        var exampleLustreFileSystem = new LustreFileSystem("exampleLustreFileSystem", LustreFileSystemArgs.builder()
            .storageCapacity(1200)
            .subnetIds(exampleAwsSubnet.id())
            .deploymentType("PERSISTENT_2")
            .perUnitStorageThroughput(125)
            .build());

        var exampleDataRepositoryAssociation = new DataRepositoryAssociation("exampleDataRepositoryAssociation", DataRepositoryAssociationArgs.builder()
            .s3(DataRepositoryAssociationS3Args.builder()
                .autoExportPolicy(DataRepositoryAssociationS3AutoExportPolicyArgs.builder()
                    .events(
                        "NEW",
                        "CHANGED",
                        "DELETED")
                    .build())
                .autoImportPolicy(DataRepositoryAssociationS3AutoImportPolicyArgs.builder()
                    .events(
                        "NEW",
                        "CHANGED",
                        "DELETED")
                    .build())
                .build())
            .fileSystemId(exampleLustreFileSystem.id())
            .dataRepositoryPath(example.id().applyValue(_id -> String.format("s3://%s", _id)))
            .fileSystemPath("/my-bucket")
            .build());

    }
}
resources:
  example:
    type: aws:s3:Bucket
    properties:
      bucket: my-bucket
  exampleBucketAcl:
    type: aws:s3:BucketAcl
    name: example
    properties:
      bucket: ${example.id}
      acl: private
  exampleLustreFileSystem:
    type: aws:fsx:LustreFileSystem
    name: example
    properties:
      storageCapacity: 1200
      subnetIds: ${exampleAwsSubnet.id}
      deploymentType: PERSISTENT_2
      perUnitStorageThroughput: 125
  exampleDataRepositoryAssociation:
    type: aws:fsx:DataRepositoryAssociation
    name: example
    properties:
      s3:
        autoExportPolicy:
          events:
            - NEW
            - CHANGED
            - DELETED
        autoImportPolicy:
          events:
            - NEW
            - CHANGED
            - DELETED
      fileSystemId: ${exampleLustreFileSystem.id}
      dataRepositoryPath: s3://${example.id}
      fileSystemPath: /my-bucket

Import

Using pulumi import, import FSx Data Repository Associations using the id. For example:

$ pulumi import aws:fsx/dataRepositoryAssociation:DataRepositoryAssociation example dra-0b1cfaeca11088b10

Constructors

DataRepositoryAssociation(String name, {DataRepositoryAssociationArgs? args, CustomResourceOptions? options})
Creates a new DataRepositoryAssociation. name The Pulumi resource name. args Arguments used to configure this DataRepositoryAssociation. The set of arguments for DataRepositoryAssociation. options Resource options controlling this resource's behavior.
DataRepositoryAssociation.reference(String urn)
Creates a typed reference to an existing DataRepositoryAssociation resource.

Properties

arn ↔ Output<String>
ARN of the file system.
latefinal
associationId ↔ Output<String>
Identifier of the data repository association.
latefinal
batchImportMetaDataOnCreate ↔ Output<bool?>
Set to true to run an import data repository task to import metadata from the data repository to the file system after the data repository association is created. Defaults to false.
latefinal
childResources → Set<Resource>
finalinherited
completionSources ↔ Map<String, IOutputCompletionSource>
latefinalinherited
dataRepositoryPath ↔ Output<String>
Path to the Amazon S3 data repository that will be linked to the file system. The path must be an S3 bucket s3://myBucket/myPrefix/. This path specifies where in the S3 data repository files will be imported from or exported to. The same S3 bucket cannot be linked more than once to the same file system.
latefinal
deleteDataInFilesystem ↔ Output<bool?>
Set to true to delete files from the file system upon deleting this data repository association. Defaults to false.
latefinal
fileSystemId ↔ Output<String>
ID of the Amazon FSx file system to on which to create a data repository association.
latefinal
fileSystemPath ↔ Output<String>
Path on the file system that points to a high-level directory (such as /ns1/) or subdirectory (such as /ns1/subdir/) that will be mapped 1-1 with dataRepositoryPath. The leading forward slash in the name is required. Two data repository associations cannot have overlapping file system paths. For example, if a data repository is associated with file system path /ns1/, then you cannot link another data repository with file system path /ns1/ns2. This path specifies where in your file system files will be exported from or imported to. This file system directory can be linked to only one Amazon S3 bucket, and no other S3 bucket can be linked to the directory.
latefinal
hashCode → int
The hash code for this object.
no setterinherited
id ↔ Output<String>
getter/setter pairinherited
importedFileChunkSize ↔ Output<int>
For files imported from a data repository, this value determines the stripe count and maximum amount of data per file (in MiB) stored on a single physical disk. The maximum number of disks that a single file can be striped across is limited by the total number of disks that make up the file system.
latefinal
isCustom → bool
Returns whether this resource is provider-managed.
no setterinherited
isProtected → bool
Returns whether this resource is protected from deletion.
no setterinherited
isRemote → bool
Whether this resource is registered as remote.
no setterinherited
isResourceReference → bool
Whether this instance represents a resource value returned over RPC.
finalinherited
region ↔ Output<String>
Region where this resource will be managed. Defaults to the Region set in the provider configuration.
latefinal
resourceTransforms → List<ResourceTransform>
Inherited/explicit async transforms.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
s3 ↔ Output<DataRepositoryAssociationS3>
Configuration for an Amazon S3 data repository linked to an Amazon FSx Lustre file system with a data repository association. This configuration defines which file events (new, changed, or deleted files or directories) are automatically imported from the linked data repository to the file system or automatically exported from the file system to the data repository. See the s3 Block below. Max of 1.
latefinal
tags ↔ Output<Map<String, String>?>
Map of tags to assign to the data repository association. If configured with a provider defaultTags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
latefinal
tagsAll ↔ Output<Map<String, String>>
Map of tags assigned to the resource, including those inherited from the provider defaultTags configuration block.
latefinal
transformations → List<ResourceTransformation>
Inherited/explicit legacy transformations.
no setterinherited
urn ↔ Output<String>
latefinalinherited

Methods

failId(Object error) → void
Completes this resource ID with an error when registration fails.
inherited
failOutputs(Object error) → void
Completes all output properties with error.
inherited
failUrn(Object error) → void
Completes this resource URN with an error when registration fails.
inherited
getProvider(String moduleMember) → ProviderResource?
Returns provider for moduleMember's package, if configured.
inherited
getResourceName() → String
Returns this resource's logical name.
inherited
getResourceType() → String
Returns this resource's Pulumi type token.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerOutput<T>(String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output<T>
Registers a dynamic output property for this resource.
inherited
resolveId(String? value, {required bool isKnown}) → void
Resolves the provider-assigned ID for this resource.
inherited
resolveOutputs(Struct outputs) → void
Resolves all output properties from a monitor response payload.
inherited
resolveUrn(String value) → void
Resolves this resource's URN once assigned by the engine.
inherited
serializeProperties(Map<String, dynamic> properties) → Future<Struct>
Serializes resource properties for RPC transmission.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

get(String name, Input<String> id, {DataRepositoryAssociationState? state, CustomResourceOptions? options}) → DataRepositoryAssociation
Gets an existing DataRepositoryAssociation resource's state with the given name and id.