# CfnLocationNFSProps

Properties for defining a `CfnLocationNFS`.

Used as props by: [CfnLocationNFS](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_datasync.CfnLocationNFS.html)

- Source: Generated at build time
- Type last changed: v2.61.0 · 19 Jan 2023

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_datasync as datasync } from 'aws-cdk-lib';
const cfnLocationNFSProps: datasync.CfnLocationNFSProps = {
  onPremConfig: {
    agentArns: ['agentArns'],
  },

  // the properties below are optional
  mountOptions: {
    version: 'version',
  },
  serverHostname: 'serverHostname',
  subdirectory: 'subdirectory',
  tags: [{
    key: 'key',
    value: 'value',
  }],
};
```

Python:

```python
from aws_cdk import CfnTag
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_datasync as datasync

cfn_location_nfs_props = datasync.CfnLocationNFSProps(
    on_prem_config=datasync.CfnLocationNFS.OnPremConfigProperty(
        agent_arns=["agentArns"]
    ),

    # the properties below are optional
    mount_options=datasync.CfnLocationNFS.MountOptionsProperty(
        version="version"
    ),
    server_hostname="serverHostname",
    subdirectory="subdirectory",
    tags=[CfnTag(
        key="key",
        value="value"
    )]
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.datasync.*;

CfnLocationNFSProps cfnLocationNFSProps = CfnLocationNFSProps.builder()
        .onPremConfig(OnPremConfigProperty.builder()
                .agentArns(List.of("agentArns"))
                .build())

        // the properties below are optional
        .mountOptions(MountOptionsProperty.builder()
                .version("version")
                .build())
        .serverHostname("serverHostname")
        .subdirectory("subdirectory")
        .tags(List.of(CfnTag.builder()
                .key("key")
                .value("value")
                .build()))
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.DataSync;

var cfnLocationNFSProps = new CfnLocationNFSProps {
    OnPremConfig = new OnPremConfigProperty {
        AgentArns = new [] { "agentArns" }
    },

    // the properties below are optional
    MountOptions = new MountOptionsProperty {
        Version = "version"
    },
    ServerHostname = "serverHostname",
    Subdirectory = "subdirectory",
    Tags = new [] { new CfnTag {
        Key = "key",
        Value = "value"
    } }
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnLocationNFSProps := &CfnLocationNFSProps{
	OnPremConfig: &OnPremConfigProperty{
		AgentArns: []*string{
			jsii.String("agentArns"),
		},
	},

	// the properties below are optional
	MountOptions: &MountOptionsProperty{
		Version: jsii.String("version"),
	},
	ServerHostname: jsii.String("serverHostname"),
	Subdirectory: jsii.String("subdirectory"),
	Tags: []CfnTag{
		&CfnTag{
			Key: jsii.String("key"),
			Value: jsii.String("value"),
		},
	},
}
```

## Properties

- `mountOptions`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnLocationNFS.MountOptionsProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_datasync.CfnLocationNFS.MountOptionsProperty.html) — Specifies the options that DataSync can use to mount your NFS file server.

- `onPremConfig`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnLocationNFS.OnPremConfigProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_datasync.CfnLocationNFS.OnPremConfigProperty.html) (required) — 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) .

- `serverHostname`: string — Specifies the DNS name or IP address (IPv4 or IPv6) of the NFS file server that your DataSync agent connects to.

- `subdirectory`: string — 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) .

- `tags`: [CfnTag](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.CfnTag.html)[] — Specifies labels that help you categorize, filter, and search for your AWS resources.

  We recommend creating at least a name tag for your location.
