Skip to content

LocationEfs

Source: src/AWS/DataSync/LocationEfs.ts

A DataSync location backed by an Amazon EFS file system. Used as a source or destination endpoint of a Task.

EFS locations are immutable apart from their tags: any change to the file system, subnet, security groups, subdirectory, access point, or encryption replaces the location.

import * as AWS from "alchemy/AWS";
const location = yield* AWS.DataSync.LocationEfs("Files", {
efsFilesystemArn: files.fileSystemArn,
subnetArn: `arn:aws:ec2:${region}:${accountId}:subnet/${subnetId}`,
securityGroupArns: [
`arn:aws:ec2:${region}:${accountId}:security-group/${sgId}`,
],
});
const dest = yield* AWS.DataSync.LocationS3("Backups", {
s3BucketArn: bucket.bucketArn,
bucketAccessRoleArn: role.roleArn,
});
const task = yield* AWS.DataSync.Task("EfsBackup", {
sourceLocationArn: location.locationArn,
destinationLocationArn: dest.locationArn,
schedule: { ScheduleExpression: "cron(0 2 * * ? *)" },
});