How to Create AWS EFS and Mount on EC2 instance

Introduction:

Amazon Elastic File System is a cloud storage service provided by Amazon Web Services that is designed to provide scalable, elastic, concurrent with some restrictions and encrypted file storage for use with both AWS cloud services and on-premises resources. This tutorial will cover the configuration of EFS to mount on EC2 instance.

Configuration Steps:

Come to the AWS management Console and create the EC2 instance there Click on Instance and then go to Launch instance option: Choose and Amazon Machine Image(AMI) Configure instance details Configure security Group: This is the created instance: Launched instance

Now go to all services page and select the EFS service in storage section Now create file system Customize all the Configuration according to your requirement Assign mount target here Created file system with Name Demo Now check the availability zone in security group Now to take control your EC2 instances using ssh from command prompt using the following command Install the amazon utils there using the following the command Now create a directory here name as efs Now using this command, we mount our file system in the efs directory

Using the following command, I can see that efs mount has been completed Now create a file there and provide some content in that file Take ssh for another instance with the same method install the amazon utils there and create efs directory, and mount the efs with same command as before Now move into that efs directory So, when you list the file inside that directory you will find the file which i have created in another instance but with the help of EFS I can also get that here

With this method configuration of EFS on EC2 instance comes to an end.

FAQ
Q
How many Amazon EC2 instances can connect to a file system?
A
Amazon EFS supports one to thousands of Amazon EC2 instances connecting to a file system concurrently.
Q
How do I access my file system from outside my VPC?
A
Amazon EC2 instances within your VPC can access your file system directly, and Amazon EC2 Classic instances outside
your VPC can mount a file system via ClassicLink.
Q
What Amazon EC2 instance types and AMIs work with Amazon EFS?
A
Amazon EFS is compatible with all Linux-based AMIs for Amazon EC2. You can mix and match the instance types connected to a single file system.
Q
How do I manage a file system?
A
Amazon EFS is a fully-managed service, so all of the file storage infrastructure is managed for you. When you use Amazon EFS, you avoid the complexity of deploying and maintaining complex file system infrastructure. An Amazon EFS file system grows and shrinks automatically as you add and remove files, so you do not need to manage storage procurement or provisioning.
Q
How many file systems can I create?
A
You can create up to 1,000 file systems per region. For information on Amazon EFS limits