AWS cloud provides cost effective object storage service through S3 bucket. Amazon S3 buckets extend scalability, data availability, security and performance for storage. We can access (store / retrieve) data from anywhere at anytime from Amazon S3.
Lets see the steps to Mount S3 Bucket with an EC2 instance on Ubuntu:
Packages Installation:
$ sudo apt-get update && apt-get install awscli
$ sudo apt-get install automake autotools-dev fuse g++ git libcurl4-gnutls-dev libfuse-dev libssl-dev libxml2-dev make pkg-config
Download and Install s3fs:
$ git clone https://github.com/s3fs-fuse/s3fs-fuse.git
$ cd s3fs-fuse
$ ./autogen.sh
$ ./configure
$ make
$ sudo make install
Confirm whether the s3fs package is installed or not,
$ which s3fs
Create S3 Bucket:
Create a new S3 bucket on AWS Cloud with required set of permissions.
Configure Security Credentials:
$ aws configure
AWS Access Key ID [None]: ASDKFAOXXXXX
AWS Secret Access Key [None]: asdsjfaSldkXXXXXX
Default region name [None]: us-west-2
Default output format [None]: json
The below command is used to see the aws credentials details
Configure Mount:
Create a new Directory,
$ mkdir /s3-mount
Set the credentials in a file with access key and Secret key
$ echo ACCESS_KEY_ID:SECRET_ACCESS_KEY > /home/user_name/.passwd-s3fs
Execute the command below to mount S3 bucket to the Directory where you have created ,
$ sudo s3fs /s3-mount -o passwd_file=/home/user_name/.passwd-s3fs
Comments (0)