Elastic File System
What is EFS
- Amazon Elastic File System is a file storage service for EC2 instances.
- Amazon EFS is easy to use and provides a simple interface that allows you to create and configure file systems quickly and easily.
- With EFS, storage capacity is elastic, growing and shrinking automatically as you add and remove files, so your application have the storage they need, when they need it.
- EFS volumes can be shared by multiple EC2 instances, as of Feb 2020 some EBS volumes can also be shared.
- EFS is a great way to share files between different EC2 instances.
Description
Support the Network File System version 4 (NFSv4 protocol).
You only pay for the storage you use (no pre-provisioning required).
Can scale up to the petabytes and support thousands of concurrent NFS connections.
Data is stored across multiple AZ's within a region.
Read After Write Consistency.
Usage
- Navigate to Storage > EFS. - Create a new EFS. - When you launch your EC2 instances that will be utilizing this EFS, include 'yum install amazon-efs-utils -y 'in your bootstrap script:#!/bin/bash yum update -y yum install httpd -y service httpd start chkconfig httpd on yum install amazon-efs-utils -y
- Our EFS was provisioned into our default Security Group (sg-daa...). - Because our EC2 instances (in different security group) will be communicating to our EFS using the NFS protocol, you have to add the following inbound rule to the default Security Group: - This rule gives inbound access to our EC2 instances to access the EFS.- Access your EC2 instances to mount the EFS volume:
cd /var/www mount -t efs -o tls fs-djsfksdfj:/ /var/www/html