0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Using S3 Files with EC2 (Standard Setup)

0
Last updated at Posted at 2026-05-25

Using S3 Files with EC2 (Standard Setup)

Firstly

As of April 2026, it is now possible to mount an S3 bucket as a File System. The following guide explains how to mount S3 Files with the same region.

image.png

Overview

image-1.png

1. Create an S3 Bucket

  • Enable bucket versioning.

2. Create an S3 File System via AWS Management Console

  • The Mount Target will be automatically created.
  • Necessary IAM roles and policies will also be created automatically.

3. Configure the Security Group for the Mount Target

image.png

  • Inbound Rule: Allow TCP (Port 2049) from the EC2 instance's Security Group as the source.

4. EC2 Instance Configuration

Install S3 Files Client

  • Amazon Linux:
    sudo yum -y install amazon-efs-utils
    
    
    
  • Ubuntu:
curl [https://amazon-efs-utils.aws.com/efs-utils-installer.sh](https://amazon-efs-utils.aws.com/efs-utils-installer.sh) | sudo sh -s -- --install

EC2 Instance Role (IAM)

Attach the following policies to the EC2 instance role:

  • AmazonS3FilesClientFullAccess
  • A policy for S3 access (e.g., AmazonS3FullAccess)

Configure the Security Group for the EC2 Instance

  • Outbound Rule: Allow TCP (Port 2049) to the Mount Target's Security Group as the destination.
  • Note: If your outbound rules are set to default (Allow All), you do not need to add this manually.

Mount Instructions

sudo mkdir /mnt/my_s3files
S3_FILE_SYSTEM_ID=<dummy>
sudo mount -t s3files "${S3_FILE_SYSTEM_ID}" /mnt/my_s3files

Note on Permissions

The mount folder requires root permissions. Non-root users (like ec2-user) must use sudo to modify files within this directory.


References

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?