

# Connecting to your file system over VPC mount targets and S3 Files Endpoints

Amazon S3 Files provides two network paths to your file system: mount targets and S3 Files 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. S3 Files Endpoints let clients that run outside a VPC in the same AWS Region as your file system, such as AI agents, connect directly to your file system without dedicated networking. For information about working with VPC-based mount targets, see [Creating mount targets](s3-files-mount-targets-creating.md).

Many workloads use both paths, with mount targets for your compute inside a VPC and S3 Files 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 to Amazon S3 Files, on either path, is authenticated with AWS Identity and Access Management (IAM) and encrypted in transit with TLS. Amazon S3 Files doesn't support anonymous access. Access through S3 Files Endpoints is denied by default: a principal can connect through S3 Files Endpoints only after you explicitly grant the S3 Files Endpoint actions. You can also use condition keys to allow or deny access by network path, so you can restrict a file system to VPC-based access only.

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

The following table compares VPC mount targets and S3 Files Endpoints.


**Comparing VPC mount targets and S3 Files Endpoints**  

| Feature | VPC mount targets | S3 Files Endpoints | 
| --- | --- | --- | 
| Where your client runs | In a VPC with a mount target for the file system | AWS compute in the same AWS Region as the file system with outbound access to port 443, including compute without a VPC attachment | 
| Port | 2049 | 443 | 
| What you configure | A mount target in each Availability Zone, and security groups that allow NFS traffic | IAM permissions only. There are no networking resources to create. | 
| Mount helper | Required (amazon-efs-utils version 3.0.0 or later) | Required (amazon-efs-utils version 4.0.0 or later) | 
| IAM actions | s3files:Client\* actions | s3files:Client\* actions and the matching s3files-endpoint:Client\* actions | 
| Latency | Lowest and most consistent | Slightly higher than mount targets | 
| Cost | No additional charge | No additional charge | 

## When to use S3 Files Endpoints
<a name="s3-files-networking-when-to-use"></a>

S3 Files Endpoints simplify connectivity at scale for workloads that run outside a VPC. For example, AI agents can persist memory and share state from any runtime environment in the same AWS Region as the file system. S3 Files Endpoints require no VPC or VPC peering to reach your file system.

S3 Files 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.

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

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

## Enabling S3 Files Endpoints
<a name="s3-files-networking-enabling"></a>

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

Because `s3files-endpoint` is a separate IAM name, access through S3 Files Endpoints stays off until you grant it, even for principals with broad Amazon S3 Files permissions. Existing policies that grant `s3files:*` or `s3files:Client*`, including the `AmazonS3FilesFullAccess` managed policy, don't grant access through S3 Files Endpoints.

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

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

After you update your permissions, mounting a file system works the same way on both network paths. The mount helper (amazon-efs-utils) first checks for a mount target that the client can reach. If one is available, the client connects to it on port `2049`. If no mount target is reachable, the client connects through S3 Files Endpoints on port `443`. In both cases, the client authenticates with IAM credentials and connects over TLS. Existing file-based applications work without modification.

**Note**  
S3 Files Endpoints require amazon-efs-utils version 4.0.0 or later. For setup steps, see [Mounting S3 file systems from another VPC](s3-files-mounting.md#s3-files-mounting-cross-vpc).

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