Sharing Linux File Systems with Amazon EFS
This lesson explains Amazon EFS, a fully managed, elastic NFS file system that many Linux clients can share.
Learning outcomes
After completing this lesson, you will be able to:
- Describe what EFS provides.
- Choose availability, storage class, throughput and performance options.
- Explain how EFS cost and security are controlled.
What EFS is
Amazon Elastic File System (EFS) is a managed file system that many clients share at the same time. It uses the NFS version 4 protocol, so it serves Linux clients; Windows clients that need SMB use Amazon FSx for Windows File Server instead. Thousands of EC2 instances, ECS tasks including Fargate tasks, EKS pods and Lambda functions can mount one file system at once, across Availability Zones, through a mount target in each zone.
EFS grows and shrinks automatically as files are added and removed, and the customer pays only for the data stored, with no capacity to provision. Typical uses are shared web content, such as WordPress uploads, home directories, persistent storage for containers, machine learning datasets shared by many workers, and large files used by Lambda functions.
The following diagram shows one file system mounted in three Availability Zones.

Storage options
Amazon EFS is a shared NFS file system, and four groups of settings shape its availability, cost and performance. For availability, a Regional file system stores data across several Availability Zones and can be mounted from all of them, while a One Zone file system stores data in one zone at a lower price. Storage classes reduce cost for files that are rarely used: lifecycle management moves files that have not been accessed for a set period from Standard to Infrequent Access and then Archive, and can move them back when they are read.
The throughput mode decides how much data clients can transfer. Elastic, the default, scales automatically with demand and is charged for use, which suits unpredictable workloads. Provisioned sets a fixed level, and Bursting grows with the amount of data stored. For the performance mode, General Purpose gives the lowest latency and is recommended; Max I/O is legacy. The following table summarises the options.
| Option | Choices |
|---|---|
| Availability | Regional (multi-AZ) or One Zone (cheaper) |
| Storage classes | Standard, Infrequent Access, Archive; lifecycle management moves files after inactivity, and back on access if configured |
| Throughput modes | Elastic (default, pay per use), Provisioned (fixed), Bursting (scales with size) |
| Performance modes | General Purpose (recommended, lowest latency); Max I/O is legacy |
EFS options
Cost and security
The cost of an EFS file system depends on its configuration. The cheapest combination is the One Zone storage class with lifecycle management moving files to Infrequent Access, and Elastic throughput, which charges for the throughput actually used; One Zone suits data that can be recreated, because it is stored in a single Availability Zone. EFS costs more per gigabyte than Amazon S3, so large, rarely used data often belongs in S3 instead.
Access is controlled at several levels: security groups on the mount targets control which clients can connect, IAM authorisation controls what they can do, and access points give each application its own root directory and POSIX user, so applications sharing a file system cannot see each other's files. Data is encrypted at rest with AWS KMS and in transit with TLS. EFS replication copies a file system to another Region for disaster recovery, and on-premises servers can mount EFS over a VPN or Direct Connect.
EFS cost and security
A shared content directory for a web farm
A content management system runs on 8 Linux instances across 3 AZs. Uploaded media must be visible to all instances immediately, and most files are rarely accessed after the first month.
| Setting | Choice |
|---|---|
| File system | EFS Regional (Multi-AZ) storage |
| Throughput mode | Elastic, which scales automatically with demand |
| Cost | Lifecycle policy moving files to Infrequent Access after 30 days |
| Security | Encryption at rest and in transit; access points per application |
EFS is NFS for Linux; a Windows web farm would need FSx for Windows File Server instead.
Can Windows instances mount Amazon EFS?
Show answer
No. EFS uses NFS for Linux. Windows file shares use FSx for Windows File Server.
Exam Tips
Remember for the exam
- For a shared POSIX file system for many Linux instances across Availability Zones, use EFS.
- To lower EFS costs for rarely accessed files, use lifecycle management to move them to Infrequent Access or Archive.
- EFS does not support Windows; use FSx for Windows File Server instead.
- To give each application its own directory and identity on a shared EFS file system, use access points.
- For a shared uploads directory for an Auto Scaling web fleet, use EFS.
- For the lowest EFS cost for data that can be recreated, use One Zone with lifecycle management to Infrequent Access.