EFS (Elastic File System)
Overview
EFS (Elastic File System) provides a shared network file system for your application containers. Unlike S3 (object storage), EFS behaves like a traditional filesystem that can be mounted directly into your containers, making it ideal for applications that need shared persistent file storage across multiple container instances.
Purpose and Benefits
- Shared Storage: Multiple container instances can read and write to the same file system simultaneously
- Persistent Storage: Data persists across container restarts and redeployments
- POSIX-Compatible: Standard filesystem operations (read, write, seek, lock) work as expected
- Automatic Scaling: Grows and shrinks automatically as you add or remove files
- High Availability: Replicated across multiple availability zones
Use Cases
- Shared Configuration: Configuration files accessible by multiple containers
- User Uploads: Applications that process uploaded files across multiple instances
- Logs and Data: Shared log directories and data files
- Content Management: CMS applications with shared media storage
CLI Usage
Create EFS
tapit create efs name=name [variable=EFS_MOUNT_POINT] [mount_point=/efs]Required Parameters
name: Name for the EFS add-on (alphanumeric with hyphens)
Optional Parameters
variable: Environment variable name for the mount point path (default:EFS_MOUNT_POINT)mount_point: Path where EFS will be mounted inside containers (default:/efs)
Examples
# Create basic EFS mount
tapit create efs name=shared-files
# Create with custom mount point
tapit create efs name=uploads variable=UPLOADS_PATH mount_point=/app/uploads
# Create for shared configuration
tapit create efs name=config mount_point=/shared/configList and Show EFS
# List all addons (including EFS)
tapit list addons
# Show specific EFS details
tapit show addon name=shared-filesDelete EFS
tapit delete addon name=shared-filesWarning: This permanently deletes the EFS filesystem and all its contents.
Environment Variables
When you create an EFS add-on, Tapitalee automatically injects:
EFS_MOUNT_POINT(or custom variable name): The filesystem mount path inside your containers
Your application can use this path to read and write files that persist across deployments and are shared between container instances.
How It Works
EFS is mounted directly into your container at the specified mount_point. Your application code can read and write files at that path using standard filesystem operations:
# Python example
import os
upload_path = os.environ['EFS_MOUNT_POINT']
with open(f"{upload_path}/myfile.txt", "w") as f:
f.write("Hello from container!")# Ruby example
upload_path = ENV['EFS_MOUNT_POINT']
File.write("#{upload_path}/myfile.txt", "Hello from container!")Performance Considerations
- EFS provides lower throughput than local storage - avoid using it for high-frequency random writes
- Best suited for files that are read frequently but written infrequently
- For high-performance file access, consider using S3 or local container storage instead