CreateLocationNfsCommand

Creates a transfer location for a Network File System (NFS) file server. DataSync can use this location as a source or destination for transferring data.

Before you begin, make sure that you understand how DataSync accesses NFS file servers .

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { DataSyncClient, CreateLocationNfsCommand } from "@aws-sdk/client-datasync"; // ES Modules import
// const { DataSyncClient, CreateLocationNfsCommand } = require("@aws-sdk/client-datasync"); // CommonJS import
const client = new DataSyncClient(config);
const input = { // CreateLocationNfsRequest
  Subdirectory: "STRING_VALUE", // required
  ServerHostname: "STRING_VALUE", // required
  OnPremConfig: { // OnPremConfig
    AgentArns: [ // AgentArnList // required
      "STRING_VALUE",
    ],
  },
  MountOptions: { // NfsMountOptions
    Version: "AUTOMATIC" || "NFS3" || "NFS4_0" || "NFS4_1",
  },
  Tags: [ // InputTagList
    { // TagListEntry
      Key: "STRING_VALUE", // required
      Value: "STRING_VALUE",
    },
  ],
};
const command = new CreateLocationNfsCommand(input);
const response = await client.send(command);
// { // CreateLocationNfsResponse
//   LocationArn: "STRING_VALUE",
// };

CreateLocationNfsCommand Input

See CreateLocationNfsCommandInput for more details

Parameter
Type
Description
OnPremConfig
Required
OnPremConfig | undefined

Specifies the Amazon Resource Name (ARN) of the DataSync agent that can connect to your NFS file server.

You can specify more than one agent. For more information, see Using multiple DataSync agents .

ServerHostname
Required
string | undefined

Specifies the DNS name or IP version 4 address of the NFS file server that your DataSync agent connects to.

Subdirectory
Required
string | undefined

Specifies the export path in your NFS file server that you want DataSync to mount.

This path (or a subdirectory of the path) is where DataSync transfers data to or from. For information on configuring an export for DataSync, see Accessing NFS file servers .

MountOptions
NfsMountOptions | undefined

Specifies the options that DataSync can use to mount your NFS file server.

Tags
TagListEntry[] | undefined

Specifies labels that help you categorize, filter, and search for your Amazon Web Services resources. We recommend creating at least a name tag for your location.

CreateLocationNfsCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
LocationArn
string | undefined

The ARN of the transfer location that you created for your NFS file server.

Throws

Name
Fault
Details
InternalException
server

This exception is thrown when an error occurs in the DataSync service.

InvalidRequestException
client

This exception is thrown when the client submits a malformed request.

DataSyncServiceException
Base exception class for all service exceptions from DataSync service.