Getting Started with Amazon EFS - A Hands-On Guide

all aws amazon ec2 aws storage Feb 03, 2024

Introduction

Amazon EFS offers a simple, scalable, elastic file storage for use with AWS Cloud services and on-premises resources. It's incredibly versatile, allowing us to easily scale our storage on the fly to several petabytes without managing the underlying storage infrastructure. This blog post will walk through the basics of getting started with EFS, including how to create an EFS file system, connect it to an EC2 instance, and the role of access points in managing file system access. For a more theoretical introduction to EFS, we can refer to cloudericks.com/blog/understanding-amazon-efs.

Step 1: Create Your EFS File System

  1. Log in to AWS Management Console: Navigate to the EFS dashboard within the AWS Management Console.
  2. Create File System: Click "Create File System." We'll be prompted to configure our file system.
  3. Configure Network Access: Choose the VPC and subnets where our file system will be accessible. We need to select at least one, but for higher availability, select multiple subnets across different Availability Zones.
  4. Set Throughput and Performance Mode: Depending on our application's needs, we can choose between the Standard and Max I/O performance modes. Additionally, we can opt for Provisioned Throughput if our application requires a specific throughput level.
  5. Review and Create: Review our configuration and click "Create File System."

Step 2: Connect EFS to EC2

  1. Launch an EC2 Instance: If we don’t already have one, launch an EC2 instance in the same VPC as our EFS file system. Ensure the instance's security group allows inbound NFS traffic (port 2049).

  2. Install the EFS Mount Helper: Connect to our EC2 instance via SSH and install the Amazon EFS client to simplify mounting our file system. For Amazon Linux 2, we can use: sudo yum install -y amazon-efs-utils

  3. Mount the File System: Use the EFS mount helper to mount our file system to a directory on our EC2 instance. Replace fs-xxxx with your file system's ID and mount-point with your desired directory: sudo mount -t efs fs-xxxx:/ /mount-point

Conclusion

Amazon EFS is a powerful tool for adding scalable, managed file storage to our cloud and on-premises applications. By following the steps outlined above, we can quickly get started with EFS, connecting it to an EC2 instance for our application's needs. Whether deploying a new application or migrating existing workloads to the cloud, EFS provides a robust, simple-to-use solution for our file storage needs.

Stay connected with news and updates!

Join our mailing list to receive the latest news and updates from our team.
Don't worry, your information will not be shared.

We hate SPAM. We will never sell your information, for any reason.