Skip to content
GitHubXDiscordRSS

LocationNFS

Learn how to create, update, and manage AWS DataSync LocationNFSs using Alchemy Cloud Control.

The LocationNFS resource lets you manage AWS DataSync LocationNFSs for transferring data between your on-premises NFS servers and AWS storage services.

Create a basic NFS location with required properties and a common optional property:

import AWS from "alchemy/aws/control";
const nfsLocation = await AWS.DataSync.LocationNFS("myNFSLocation", {
ServerHostname: "nfs.example.com",
Subdirectory: "/data",
OnPremConfig: {
AgentArns: ["arn:aws:datasync:us-west-2:123456789012:agent/agent-1"]
}
});

Configure an NFS location with mount options for better performance:

const advancedNfsLocation = await AWS.DataSync.LocationNFS("advancedNFSLocation", {
ServerHostname: "nfs.example.com",
Subdirectory: "/data",
OnPremConfig: {
AgentArns: ["arn:aws:datasync:us-west-2:123456789012:agent/agent-1"]
},
MountOptions: {
Version: "nfs3",
Tls: "off"
}
});

Create an NFS location with tags for better resource management:

const taggedNfsLocation = await AWS.DataSync.LocationNFS("taggedNFSLocation", {
ServerHostname: "nfs.example.com",
Subdirectory: "/data",
OnPremConfig: {
AgentArns: ["arn:aws:datasync:us-west-2:123456789012:agent/agent-1"]
},
Tags: [
{ Key: "Environment", Value: "Production" },
{ Key: "Project", Value: "DataMigration" }
]
});

If you want to adopt an existing NFS resource rather than creating a new one, set the adopt property to true:

const adoptedNfsLocation = await AWS.DataSync.LocationNFS("adoptedNFSLocation", {
ServerHostname: "nfs.example.com",
Subdirectory: "/data",
OnPremConfig: {
AgentArns: ["arn:aws:datasync:us-west-2:123456789012:agent/agent-1"]
},
adopt: true
});