logo
Menu

How to Access Amazon S3 Bucket like a Local File System

Access Amazon S3 Bucket like a Local File System using Mountpoint for Amazon S3.

Published Feb 9, 2024
Mountpoint for Amazon S3 is now generally available and ready for production workloads. This open-source simple file client is optimized for read-heavy workloads that require high throughput and focused on high-performance access to large data sets.
In this post, we'll see how to effortlessly access an S3 bucket as a local file system by leveraging Mountpoint for Amazon S3.

Install Mountpoint for Amazon S3

Based on your Linux distributions and hardware-platform architecture, download prebuilt packages.
I am using the Ubuntu distro of Windows Subsystem for Linux (WSL2) running on x86_64 architecture. So, I'll download DEB-based distributions for x86_64.
RPM-based distributions (Amazon Linux, Fedora, CentOS, RHEL):
DEB-based distributions (Debian, Ubuntu):
Other distributions:
Install the downloaded Mountpoint for Amazon S3 package.
To make sure the installation was successful, please check the version.

Configure Mountpoint for Amazon S3

Mountpoint for Amazon S3 uses the same credentials configuration options as the AWS CLI. So, either use aws configure AWS CLI to create the credential file or create it manually.
or,
Create ~/.aws/credentials file and add aws_access_key_id and aws_secret_access_key.
Sample ~/.aws/credentials content
Now create a local directory (e.g. ~/local-dir) and mount it with an S3 bucket (e.g. aj-mounts3-bucket).

Demo - Mountpoint for Amazon S3

Now, we are good to access the S3 bucket as a local file system using different file operations.
Let's create a few files and a directory inside the mounted local directory.
Refresh S3 bucket. And we'll see the exact same files and directories in the S3 bucket as objects.

 

Comments