AWS::DataSync::LocationNFS - AWS CloudFormation


The AWS::DataSync::LocationNFS resource specifies a Network File System (NFS) file server that AWS DataSync can use as a transfer source or destination.


To declare this entity in your AWS CloudFormation template, use the following syntax:


{ "Type" : "AWS::DataSync::LocationNFS", "Properties" : { "MountOptions" : MountOptions, "OnPremConfig" : OnPremConfig, "ServerHostname" : String, "Subdirectory" : String, "Tags" : [ Tag, ... ] } }


Type: AWS::DataSync::LocationNFS Properties: MountOptions: MountOptions OnPremConfig: OnPremConfig ServerHostname: String Subdirectory: String Tags: - Tag



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

Required: No

Type: MountOptions

Update requires: No interruption


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

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

Required: Yes

Type: OnPremConfig

Update requires: No interruption


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

Required: No

Type: String

Pattern: ^(([a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9\-]*[A-Za-z0-9])$

Maximum: 255

Update requires: Replacement


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.

Required: No

Type: String

Pattern: ^[a-zA-Z0-9_\-\+\./\(\)\$\p{Zs}]+$

Maximum: 4096

Update requires: No interruption


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

Required: No

Type: Array of Tag

Maximum: 50

Update requires: No interruption

Return values


When you pass the logical ID of this resource to the intrinsic Ref function, Ref returns the location resource ARN. For example:


For more information about using the Ref function, see Ref.


The Fn::GetAtt intrinsic function returns a value for a specified attribute of this type. The following are the available attributes and sample return values.

For more information about using the Fn::GetAtt intrinsic function, see Fn::GetAtt.


The Amazon Resource Name (ARN) of the NFS location that you created.


The URI of the NFS location that you created.


Create an NFS location for DataSync

The following example specifies an NFS location for DataSync, using a source and destination location. In this example, the server hostname is, using NFS version 4.0, in the subdirectory /MySubdirectory.


{ "Resources": { "LocationNFS": { "Type": "AWS::DataSync::LocationNFS", "Properties": { "MountOptions": { "Version": "NFS4_0" }, "OnPremConfig": { "AgentArns": [ "arn:aws:datasync:us-east-2:111222333444:agent/agent-000addbcdf44bbnfs" ] }, "ServerHostname": "", "Subdirectory": "/MySubdirectory" } } } }


Resources: LocationNFS: Type: 'AWS::DataSync::LocationNFS' Properties: MountOptions: Version: NFS4_0 OnPremConfig: AgentArns: - >- arn:aws:datasync:us-east-2:111222333444:agent/agent-000addbcdf44bbnfs ServerHostname: Subdirectory: /MySubdirectory