When to Use EFS
Your agents store local data
Your agents store local data
Agents like Pal use DuckDB to store structured data locally. Without EFS, this data is lost when containers restart.
You need data to survive deployments
You need data to survive deployments
Each
ag infra up creates new containers. EFS ensures your data persists across deployments.Pal Agent Requirements
DuckDB Single Worker Requirement
Multiple workers cause “database is locked” errors and potential data corruption.Data Persistence Summary
Architecture
Setup Guide
1
Create an EFS File System
Create a new file system in your AWS region:Save the
FileSystemId from the response (e.g., fs-0123456789abcdef0).2
Create an Access Point
Access points provide application-specific entry points with user/permission mapping:Save the
AccessPointId from the response (e.g., fsap-0123456789abcdef0).The UID/GID
61000 matches the non-root user in the AgentOS container. This ensures your application can read and write to EFS.3
Configure Infrastructure Settings
Update
infra/settings.py with your EFS IDs:infra/settings.py
4
Create Mount Targets
EFS needs mount targets in each subnet your ECS tasks use. First, deploy to create the EFS security group:Then get the security group ID:Create mount targets in each subnet:
5
Verify and Redeploy
Redeploy to pick up the EFS configuration:Verify the mount by checking your container logs:You should see your application start without errors. Data written to
/data now persists across restarts.Settings Reference
How It Works
When you configure EFS settings, the infrastructure automatically:- Creates a security group (
*-efs-sg) allowing NFS traffic (port 2049) from your app containers - Configures an ECS volume with transit encryption enabled
- Mounts the volume at
/datain your container
prd_resources.py:
Cost
EFS pricing is based on storage used:
Example costs:
- 1 GB of agent data: ~$0.30/month
- 10 GB of documents: ~$3.00/month
Troubleshooting
Mount target not found
Mount target not found
Ensure you’ve created mount targets in the same subnets specified in
infra/settings.py. Each subnet needs its own mount target.Permission denied errors
Permission denied errors
Check that your access point uses UID/GID
61000 to match the container user. Verify with:ECS task fails to start
ECS task fails to start
Check that the EFS security group allows inbound NFS (port 2049) from your app security group:
Data not persisting
Data not persisting
Ensure your application writes to
/data, not another directory. Verify the EFS volume is mounted at /data in your container configuration.