You are viewing a free preview of this lesson.
Subscribe to unlock all 10 lessons in this course and every other course on LearningBro.
While S3 provides object storage and EBS provides block storage, many workloads require shared file storage — a file system that multiple servers can mount and access concurrently. Amazon Elastic File System (EFS) and Amazon FSx address this need.
EFS is a fully managed, elastic, POSIX-compliant file system for Linux workloads. It grows and shrinks automatically as you add and remove files — no provisioning required.
| Feature | Detail |
|---|---|
| Protocol | NFS v4.0 and v4.1 |
| Elasticity | Automatically scales from zero to petabytes |
| Concurrency | Thousands of EC2 instances can mount the same file system simultaneously |
| Availability | Data stored across multiple AZs (Standard) or single AZ (One Zone) |
| Durability | 99.999999999% (eleven 9s) for Standard classes |
| OS support | Linux only (not Windows) |
| Storage Class | Description | Use Case |
|---|---|---|
| Standard | Multi-AZ, high availability | Production workloads |
| Standard-IA | Multi-AZ, lower cost, retrieval fee | Infrequently accessed files |
| One Zone | Single AZ, lower cost | Dev/test, non-critical workloads |
| One Zone-IA | Single AZ + infrequent access | Lowest cost for non-critical, rarely accessed files |
EFS supports lifecycle management to automatically move files between Standard and IA classes based on access patterns.
| Mode | Description | Best For |
|---|---|---|
| General Purpose | Low latency, suitable for most workloads | Web serving, CMS, home directories |
| Max I/O | Higher aggregate throughput, slightly higher latency | Big data, media processing |
| Mode | Description |
|---|---|
| Bursting | Throughput scales with file system size; burst credits for spikes |
| Provisioned | You specify the throughput independently of storage size |
| Elastic | Automatically scales throughput up and down based on workload demand |
# Create the file system
aws efs create-file-system \
--performance-mode generalPurpose \
--throughput-mode elastic \
--encrypted \
--tags Key=Name,Value=my-shared-fs
# Create a mount target in each AZ
aws efs create-mount-target \
--file-system-id fs-0123456789abcdef0 \
--subnet-id subnet-abc123 \
--security-groups sg-xyz789
Using the EFS mount helper (recommended):
# Install the EFS utilities
sudo yum install -y amazon-efs-utils
# Mount with encryption in transit
sudo mount -t efs -o tls fs-0123456789abcdef0:/ /mnt/efs
# Add to fstab for automatic mounting
echo 'fs-0123456789abcdef0:/ /mnt/efs efs _netdev,tls 0 0' | sudo tee -a /etc/fstab
EFS integrates with Amazon ECS and EKS as a persistent volume:
This enables stateful containers that share data across tasks or pods.
Access points are application-specific entry points into an EFS file system. Each access point can enforce:
Subscribe to continue reading
Get full access to this lesson and all 10 lessons in this course.