Amazon Elastic File System (Amazon EFS) provides simple, scalable file storage for use with Amazon EC2. With Amazon EFS, storage capacity is elastic, growing and shrinking automatically as you add and remove files, so your applications have the storage they need, when they need it. Amazon EFS has a simple web services interface that allows you to create and configure file systems quickly and easily. The service manages all the file storage infrastructure for you, meaning that you can avoid the complexity of deploying, patching, and maintaining complex file system configurations.
AWS EFS is actually quite a relatively easy service to setup and use, let’s start by creating mount targets for EC2 to be mounted.
Tag your EFS if you want to. Enable lifecycle management is a new feature added to EFS which will save you cost.
The rest of settings are pretty well explained, configure them according to your needs.
Lastly, a review page and we can create the mount points!
Status of mount point is shown at the lower right corner. It is ready when you see status changed to available.
And that’s it, AWS EFS mount point is successfully created! As shown in the image, there are instructions how to connect EFS from various locations.
Let’s now switch to an EC2. Here I used AMI provided by AWS and according to the instruction, I can simply install an EFS mount helper and it will help me mount EFS easily.
sudo yum install -y amazon-efs-utils
Next, I have a folder called efs and I mount EFS mount point to efs folder. After that, we can see that EFS was mounted successfully.
sudo mount -t efs efs-mount-point-dns:/ efs
Now let’s put a file into efs folder to verify that everything function correctly.
sudo dd if=/dev/zero of=/home/ec2-user/efs/test.log bs=1M count=10
There you go! Test file was written to efs successfully!