

This is the new *CloudFormation Template Reference Guide*. Please update your bookmarks and links. For help getting started with CloudFormation, see the [AWS CloudFormation User Guide](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/Welcome.html).

# AWS::DataSync::LocationNFS
<a name="aws-resource-datasync-locationnfs"></a>

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

## Syntax
<a name="aws-resource-datasync-locationnfs-syntax"></a>

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

### JSON
<a name="aws-resource-datasync-locationnfs-syntax.json"></a>

```
{
  "Type" : "AWS::DataSync::LocationNFS",
  "Properties" : {
      "[MountOptions](#cfn-datasync-locationnfs-mountoptions)" : MountOptions,
      "[OnPremConfig](#cfn-datasync-locationnfs-onpremconfig)" : OnPremConfig,
      "[ServerHostname](#cfn-datasync-locationnfs-serverhostname)" : String,
      "[Subdirectory](#cfn-datasync-locationnfs-subdirectory)" : String,
      "[Tags](#cfn-datasync-locationnfs-tags)" : [ Tag, ... ]
    }
}
```

### YAML
<a name="aws-resource-datasync-locationnfs-syntax.yaml"></a>

```
Type: AWS::DataSync::LocationNFS
Properties:
  [MountOptions](#cfn-datasync-locationnfs-mountoptions): 
    MountOptions
  [OnPremConfig](#cfn-datasync-locationnfs-onpremconfig): 
    OnPremConfig
  [ServerHostname](#cfn-datasync-locationnfs-serverhostname): String
  [Subdirectory](#cfn-datasync-locationnfs-subdirectory): String
  [Tags](#cfn-datasync-locationnfs-tags): 
    - Tag
```

## Properties
<a name="aws-resource-datasync-locationnfs-properties"></a>

`MountOptions`  <a name="cfn-datasync-locationnfs-mountoptions"></a>
Specifies the options that DataSync can use to mount your NFS file server.  
*Required*: No  
*Type*: [MountOptions](aws-properties-datasync-locationnfs-mountoptions.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`OnPremConfig`  <a name="cfn-datasync-locationnfs-onpremconfig"></a>
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](https://docs.aws.amazon.com/datasync/latest/userguide/do-i-need-datasync-agent.html#multiple-agents).  
*Required*: Yes  
*Type*: [OnPremConfig](aws-properties-datasync-locationnfs-onpremconfig.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`ServerHostname`  <a name="cfn-datasync-locationnfs-serverhostname"></a>
Specifies the DNS name or IP address (IPv4 or IPv6) 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*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Subdirectory`  <a name="cfn-datasync-locationnfs-subdirectory"></a>
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](https://docs.aws.amazon.com/datasync/latest/userguide/create-nfs-location.html#accessing-nfs).  
*Required*: No  
*Type*: String  
*Pattern*: `^[a-zA-Z0-9_\-\+\./\(\)\$\p{Zs}]+$`  
*Maximum*: `4096`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Tags`  <a name="cfn-datasync-locationnfs-tags"></a>
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](aws-properties-datasync-locationnfs-tag.md)  
*Maximum*: `50`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

## Return values
<a name="aws-resource-datasync-locationnfs-return-values"></a>

### Ref
<a name="aws-resource-datasync-locationnfs-return-values-ref"></a>

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

 `arn:aws:datasync:us-east-2:111222333444:location/loc-07db7abfc326c50s3` 

For more information about using the `Ref` function, see [Ref](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-ref.html).

### Fn::GetAtt
<a name="aws-resource-datasync-locationnfs-return-values-fn--getatt"></a>

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](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-getatt.html).

#### 
<a name="aws-resource-datasync-locationnfs-return-values-fn--getatt-fn--getatt"></a>

`LocationArn`  <a name="LocationArn-fn::getatt"></a>
The Amazon Resource Name (ARN) of the NFS location that you created.

`LocationUri`  <a name="LocationUri-fn::getatt"></a>
The URI of the NFS location that you created.

## Examples
<a name="aws-resource-datasync-locationnfs--examples"></a>



### Create an NFS location for DataSync
<a name="aws-resource-datasync-locationnfs--examples--Create_an_NFS_location_for_DataSync"></a>

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

#### JSON
<a name="aws-resource-datasync-locationnfs--examples--Create_an_NFS_location_for_DataSync--json"></a>

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

#### YAML
<a name="aws-resource-datasync-locationnfs--examples--Create_an_NFS_location_for_DataSync--yaml"></a>

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

# AWS::DataSync::LocationNFS MountOptions
<a name="aws-properties-datasync-locationnfs-mountoptions"></a>

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

## Syntax
<a name="aws-properties-datasync-locationnfs-mountoptions-syntax"></a>

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

### JSON
<a name="aws-properties-datasync-locationnfs-mountoptions-syntax.json"></a>

```
{
  "[Version](#cfn-datasync-locationnfs-mountoptions-version)" : String
}
```

### YAML
<a name="aws-properties-datasync-locationnfs-mountoptions-syntax.yaml"></a>

```
  [Version](#cfn-datasync-locationnfs-mountoptions-version): String
```

## Properties
<a name="aws-properties-datasync-locationnfs-mountoptions-properties"></a>

`Version`  <a name="cfn-datasync-locationnfs-mountoptions-version"></a>
Specifies the NFS version that you want DataSync to use when mounting your NFS share. If the server refuses to use the version specified, the task fails.  
You can specify the following options:  
+ `AUTOMATIC` (default): DataSync chooses NFS version 4.1.
+ `NFS3`: Stateless protocol version that allows for asynchronous writes on the server.
+ `NFSv4_0`: Stateful, firewall-friendly protocol version that supports delegations and pseudo file systems.
+ `NFSv4_1`: Stateful protocol version that supports sessions, directory delegations, and parallel data processing. NFS version 4.1 also includes all features available in version 4.0.
DataSync currently only supports NFS version 3 with Amazon FSx for NetApp ONTAP locations.
*Required*: No  
*Type*: String  
*Allowed values*: `AUTOMATIC | NFS3 | NFS4_0 | NFS4_1`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::DataSync::LocationNFS OnPremConfig
<a name="aws-properties-datasync-locationnfs-onpremconfig"></a>

The AWS DataSync agents that can connect to your Network File System (NFS) file server.

## Syntax
<a name="aws-properties-datasync-locationnfs-onpremconfig-syntax"></a>

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

### JSON
<a name="aws-properties-datasync-locationnfs-onpremconfig-syntax.json"></a>

```
{
  "[AgentArns](#cfn-datasync-locationnfs-onpremconfig-agentarns)" : [ String, ... ]
}
```

### YAML
<a name="aws-properties-datasync-locationnfs-onpremconfig-syntax.yaml"></a>

```
  [AgentArns](#cfn-datasync-locationnfs-onpremconfig-agentarns): 
    - String
```

## Properties
<a name="aws-properties-datasync-locationnfs-onpremconfig-properties"></a>

`AgentArns`  <a name="cfn-datasync-locationnfs-onpremconfig-agentarns"></a>
The Amazon Resource Names (ARNs) of the DataSync agents that can connect to your NFS file server.  
You can specify more than one agent. For more information, see [Using multiple DataSync agents](https://docs.aws.amazon.com/datasync/latest/userguide/do-i-need-datasync-agent.html#multiple-agents).  
*Required*: Yes  
*Type*: Array of String  
*Minimum*: `1`  
*Maximum*: `128 | 8`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::DataSync::LocationNFS Tag
<a name="aws-properties-datasync-locationnfs-tag"></a>

<a name="aws-properties-datasync-locationnfs-tag-description"></a>The `Tag` property type specifies Property description not available. for an [AWS::DataSync::LocationNFS](aws-resource-datasync-locationnfs.md).

## Syntax
<a name="aws-properties-datasync-locationnfs-tag-syntax"></a>

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

### JSON
<a name="aws-properties-datasync-locationnfs-tag-syntax.json"></a>

```
{
  "[Key](#cfn-datasync-locationnfs-tag-key)" : String,
  "[Value](#cfn-datasync-locationnfs-tag-value)" : String
}
```

### YAML
<a name="aws-properties-datasync-locationnfs-tag-syntax.yaml"></a>

```
  [Key](#cfn-datasync-locationnfs-tag-key): String
  [Value](#cfn-datasync-locationnfs-tag-value): String
```

## Properties
<a name="aws-properties-datasync-locationnfs-tag-properties"></a>

`Key`  <a name="cfn-datasync-locationnfs-tag-key"></a>
Property description not available.  
*Required*: Yes  
*Type*: String  
*Pattern*: `^[a-zA-Z0-9\s+=._:/-]+$`  
*Minimum*: `1`  
*Maximum*: `256`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Value`  <a name="cfn-datasync-locationnfs-tag-value"></a>
Property description not available.  
*Required*: Yes  
*Type*: String  
*Pattern*: `^[a-zA-Z0-9\s+=._:@/-]+$`  
*Minimum*: `1`  
*Maximum*: `256`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)