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
Create an EFS (Elastic File System) for shared persistent storage
tapit create efs name=name [variable=EFS_MOUNT_POINT] [mount_point=/efs] [--ignore-existing]
Parameters
name: Name for the EFS add-on (required)variable: Environment variable name for the mount point (default: EFS_MOUNT_POINT)mount_point: Path where EFS will be mounted in containers (default: /efs)--ignore-existing: Skip creation if a resource with the same name already exists (useful for idempotent scripts)
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/config
List and Show EFS
List all add-ons attached to the app with their state and configuration
tapit list addons [-w|--wait]
Parameters
-w|--wait: Wait until all add-ons reach a stable state (fully ready or fully deleted); exits non-zero if any add-on is in a failed state
Show detailed information about a specific add-on
tapit show addon name=addon_name
Parameters
name: Name of the add-on to show (required)
Delete EFS
Delete an add-on and all its associated AWS resources
tapit delete addon name=addon_name
Parameters
name: Name of the add-on to delete (required)
Warning: 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