Skip to content
GitHubXDiscord

DataRepositoryAssociation

The DataRepositoryAssociation resource allows you to manage associations between an FSx file system and an Amazon S3 data repository. For more details, refer to the AWS FSx DataRepositoryAssociations documentation.

Create a basic DataRepositoryAssociation with required properties and a common optional property.

import AWS from "alchemy/aws/control";
const dataRepositoryAssociation = await AWS.FSx.DataRepositoryAssociation("basicAssociation", {
FileSystemPath: "/data",
DataRepositoryPath: "s3://my-data-repo/path",
FileSystemId: "fs-0123456789abcdef0",
BatchImportMetaDataOnCreate: true
});

Configure a DataRepositoryAssociation with additional properties for chunk size and tags.

const advancedDataRepositoryAssociation = await AWS.FSx.DataRepositoryAssociation("advancedAssociation", {
FileSystemPath: "/data",
DataRepositoryPath: "s3://my-data-repo/advanced-path",
FileSystemId: "fs-0123456789abcdef0",
ImportedFileChunkSize: 1048576, // 1 MB
Tags: [
{ Key: "Environment", Value: "Production" },
{ Key: "Project", Value: "DataSync" }
]
});

Example with Adoption of Existing Resource

Section titled “Example with Adoption of Existing Resource”

Create a DataRepositoryAssociation that adopts an existing resource instead of failing if it already exists.

const adoptExistingAssociation = await AWS.FSx.DataRepositoryAssociation("existingAssociation", {
FileSystemPath: "/data",
DataRepositoryPath: "s3://my-data-repo/existing-path",
FileSystemId: "fs-0123456789abcdef0",
adopt: true
});