Getting Started with Amazon EFS Access Points - A Hands-On Guide

all aws amazon ec2 aws security 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. EFS Access Points are a feature that makes it even easier to manage file system access for our applications, providing a secure and scalable way to streamline access to EFS file systems. This blog post will walk us through the basics of EFS Access Points, including prerequisites, how to create an access point, and how to connect it to an EC2 instance. 

What are EFS Access Points?

EFS Access Points are application-specific entry points into an EFS file system that make it easier to manage access at the application level. They allow us to enforce a user identity for all file system requests made through the access point and to apply a root directory for the application to access. This simplifies managing file access for applications, ensures secure access, and facilitates multi-user and application-specific data segregation. For a more detailed theoretical introduction to EFS access points, refer to cloudericks.com/blog/understanding-amazon-efs-access-points.

Prerequisites

Before we start, we need to ensure we have the following prerequisites in place:

  • AWS Account: We need an active AWS account.
  • EFS File System: We should have an EFS file system set up in your AWS account. If you haven't created one, refer to cloudericks.com/blog/getting-started-with-amazon-efs-a-hands-on-guide.
  • EC2 Instance: Ensure we have an EC2 instance running in the same VPC as our EFS file system. This instance will be used to connect to the EFS file system via the access point.

Step 1: Create an EFS Access Point

  1. Log into the AWS Management Console and navigate to the EFS dashboard.
  2. Select our EFS file system for which we want to create an access point.
  3. Click on "Access Points" in the sidebar and then on "Create Access Point".
  4. Provide the access point settings:
    • Name: A unique name for our access point.
    • POSIX user: User and group IDs for managing access. This controls the owner of files and directories.
    • Root directory: Define the root directory and creation permissions if the directory doesn't exist.
  5. Click on "Create Access Point". Note down the Access Point ID once created.

Step 2: Connect to EFS from an EC2 Instance

  1. Connect to our EC2 instance via SSH.

  2. Ensure the Amazon EFS client is installed. If not, install it using the command: sudo yum install -y amazon-efs-utils

  3. Mount the EFS file system using the access point: sudo mount -t efs -o tls,accesspoint=<Access Point ID> <File System ID>:/ /mnt/efs

    Replace <Access Point ID> with your access point's ID and <File System ID> with your EFS file system's ID.
  4. We can now access our EFS file system via the access point at /mnt/efs.

Benefits of Using EFS Access Points

  • Simplified Access Management: Access Points eliminate the complexity of managing user permissions at the file system level.
  • Enhanced Security: They allow us to apply fine-grained access control, ensuring applications and users only have access to the required data.
  • Easy Multi-User Support: With Access Points, managing data access for multiple users and applications becomes straightforward, enabling data isolation and security.
  • Seamless Integration: EFS Access Points work seamlessly with AWS services, making it easy to integrate with your existing AWS infrastructure.

Conclusion

Amazon EFS Access Points provide a powerful and flexible way to manage file access for our applications running in the AWS cloud. By following the steps outlined in this guide, we can easily create and use access points, improving our application's security and simplifying data management. With the benefits of simplified access management, enhanced security, and easy integration, EFS Access Points are an essential tool for anyone looking to optimize their AWS file storage setup.

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.