

# Configuring your network

Amazon EFS provides two network paths to your file system: mount targets and EFS Endpoints. A mount target is a network interface you create in a subnet of your virtual private cloud (VPC) that your compute uses to connect to your file system. EFS Endpoints let clients outside the file system's VPC in the same AWS Region, such as AI agents and compute in other VPCs and AWS accounts, connect directly to your file system without dedicated networking. For information about working with mount targets, see [Managing mount targets](accessing-fs.md).

Many workloads use both paths, with mount targets for your compute inside a VPC and EFS Endpoints for everything else. The two paths operate independently, and you don't need to choose one for your file system. When both paths are available to a client, the mount helper automatically connects through the mount target.

Every connection through EFS Endpoints is authenticated with AWS Identity and Access Management (IAM) and encrypted in transit with TLS. Unlike mount targets, EFS Endpoints don't support anonymous clients, even when the default file system policy is in effect. Access through EFS Endpoints is denied by default: a principal can connect through EFS Endpoints only after you explicitly grant the EFS Endpoint actions. You can also use condition keys to allow or deny access by network path, so you can restrict a file system to mount targets only.

## Comparing network paths
<a name="efs-networking-comparing"></a>

The following table compares mount targets and EFS Endpoints.


**Comparing mount targets and EFS Endpoints**  

| Feature | Mount targets | EFS Endpoints | 
| --- | --- | --- | 
| Where your client runs | In the file system's VPC, or in a VPC or on-premises network that is connected to it | AWS compute in the same AWS Region as the file system with outbound access to port 443, including compute in other VPCs and AWS accounts | 
| Port | 2049 | 443 | 
| What you configure | A mount target in each Availability Zone, security groups that allow NFS traffic, and VPC peering, a transit gateway, or a VPN for clients outside the VPC | IAM permissions only. There are no networking resources to create. | 
| Mount helper | Optional. You can also mount with a standard NFS client. | Required: the EFS mount helper (amazon-efs-utils version 4.0.0 or later) with the tls and iam mount options | 
| Authentication and encryption | IAM authorization and TLS are optional | IAM authorization and TLS are required | 
| IAM actions | elasticfilesystem:Client\* actions, when you use IAM authorization | elasticfilesystem:Client\* actions and the matching elasticfilesystem-endpoint:Client\* actions | 
| Latency | Lowest and most consistent | Slightly higher than mount targets | 
| Cost | No additional charge | No additional charge | 

## When to use EFS Endpoints
<a name="efs-networking-when-to-use"></a>

EFS Endpoints simplify connectivity at scale for workloads that run outside the file system's VPC. For example, AI agents can persist memory and share state from any runtime environment in the same AWS Region as the file system. Compute in another VPC or AWS account in the same AWS Region can mount a file system without VPC peering or a transit gateway.

EFS Endpoints support clients that run on AWS compute in the same AWS Region as the file system. Connecting from other AWS Regions or from on-premises networks isn't supported, because the added network latency reduces file system performance. To mount a file system from another AWS Region or from an on-premises network, use a mount target. For more information, see [Managing mount targets](accessing-fs.md).

Traffic from clients running on AWS compute stays on the AWS global network and is encrypted in transit with TLS.

Use mount targets for compute that runs inside the file system's VPC. Mount targets provide the lowest latency and don't require outbound access from the VPC. To use EFS Endpoints from inside a VPC, the VPC needs an internet gateway or NAT gateway, and NAT gateway data processing charges apply to that traffic.

EFS Endpoints aren't available for file systems that use the Max I/O performance mode. For more information, see [Performance modes](performance.md#performancemodes).

## Enabling EFS Endpoints
<a name="efs-networking-enabling"></a>

You enable EFS Endpoints by granting IAM permissions. There are no networking resources to create. To connect through EFS Endpoints, a principal needs the following permissions:
+ `elasticfilesystem:CreateMountSession`, which the mount helper uses to get connection information for the file system.
+ Each client action that it uses, in both the `elasticfilesystem` and `elasticfilesystem-endpoint` IAM names. For example, read access requires both `elasticfilesystem:ClientMount` and `elasticfilesystem-endpoint:ClientMount`.

Because `elasticfilesystem-endpoint` is a separate IAM name, access through EFS Endpoints stays off until you grant it, even for principals with broad EFS permissions. The following don't grant access through EFS Endpoints:
+ Existing policies that grant `elasticfilesystem:*` or `elasticfilesystem:Client*`
+ The existing AWS managed policies for EFS
+ The default file system policy

For more information about the required permissions, see [Permissions for EFS Endpoints](efs-networking-endpoint-permissions.md). For example policies, see [Policy examples for network access](efs-networking-policy-examples.md).

## How clients connect
<a name="efs-networking-how-clients-connect"></a>

After you update your permissions, you mount a file system with the EFS mount helper and the `tls` and `iam` mount options, the same way on both network paths.

```
$ sudo mount -t efs -o tls,iam {{file-system-id}} {{efs-mount-point}}/
```

Replace {{file-system-id}} with the ID of your file system and {{efs-mount-point}} with the local directory where you want to mount it.

The mount helper first looks for a mount target that the client can reach, by resolving the file system's DNS name and, if that fails, by calling [DescribeMountTargets](https://docs.aws.amazon.com/efs/latest/APIReference/API_DescribeMountTargets.html). If a mount target is reachable, the client connects to it on port `2049`. If no mount target is reachable, the client connects through EFS Endpoints on port `443`. In both cases, the client authenticates with IAM credentials and connects over TLS. Without the `tls` and `iam` mount options, the mount helper connects only through a mount target. Existing file-based applications work without modification. For more information about mounting with IAM, see [Mounting with IAM authorization](mounting-IAM-option.md). For a step-by-step example, see [Tutorial: Mount a file system from outside its VPC using EFS Endpoints](efs-endpoints-tutorial.md).

To control which network path the mount helper uses, set `connection_mode` in `/etc/amazon/efs/efs-utils.conf` to `auto` (the default), `mount_target`, or `endpoint`.

**Note**  
EFS Endpoints require amazon-efs-utils version 4.0.0 or later. For more information, see [Installing the Amazon EFS client](using-amazon-efs-utils.md). To use AWS credentials other than the default credentials on the host, see [Mounting with IAM using a named profile](mounting-IAM-option.md#mount-iam-creds-file).

**Topics**
+ [Comparing network paths](#efs-networking-comparing)
+ [When to use EFS Endpoints](#efs-networking-when-to-use)
+ [Enabling EFS Endpoints](#efs-networking-enabling)
+ [How clients connect](#efs-networking-how-clients-connect)
+ [Permissions for EFS Endpoints](efs-networking-endpoint-permissions.md)
+ [Policy examples for network access](efs-networking-policy-examples.md)