AWS S3 Upload File

In this article we are going to map S3 bucket as a network drive in Windows or AWS S3 upload file with the help of FTP software and it is available for Linux system also.

If you want to add S3 bucket as a network drive into your system and upload, download data with less or without human interaction, then here we have AWS official software for Microsoft Windows and Linux based system as well.

We can do the same with “Aws management console” and S3 browser FTP client as well but it will be time taking and need lots of human interaction so far.

How To Map S3 Bucket In Windows

Windows: – TntDrive (To mount Amazone S3 Bucket as Windows drive.)

It is license-based but has 30 days trial available and required an IAM user and it should have rights on the S3 bucket. It is like S3 browser software.

So we will be needed IAM user with (Programmatic Access“Access key ID” and “Secret access key”, you can create the same from the AWS console portal.

Where To Download the Software

Download TntDrive and install the software and run the same.

How To Install and Map S3 Bucket

After installing run it and click on “Add New Mapped Drive”

aws s3 upload file

Here you have to add the “Storage Account” click on the pencil icon and “ADD” give the account name and give “Access Key ID” and “Secret Access Key” of IAM user and click on “Add new account”

It will send an API call to your AWS account for authentication and if all details are correct, the account will be added.

Now you can browse the S3 bucket which you want to add, click on “Amazon S3 bucket”  and select the bucket you need to mount.

Give the “Mapped drive letter and click “Add new drive” 

Here you can see the mapped drive which you have added click on “Open” it will map the bucket.

As of now, you can see the AWS S3 bucket as a drive mapped in your system. Now you can copy and paste the data into the mapped drive and it will reflect in your console also.

How To Mount Bucket Inside Linux Machine

Follow the below steps: –

Create an EC2 Instance (Linux 8.2) and access the same through the ssh. You can do this activity on your laptop or VM running on VMware itself. You should have internet access on system itself.

Step1: –

  • #yum install automake fuse fuse-devel gcc-c++ git libcurl-devel libxml2-devel make openssl-devel mailcap -y
Download software named s3fs
  • #git clone https://github.com/s3fs-fuse/s3fs-fuse.git
  • #ls
Directory should be here name s3fs
  • #cd s3fs-fuse/
  • #./autogen.sh
  • #./configure –prefix=/usr –with-openssl
  • #make
  • #make install
  • #which s3fs

Output: -/usr/bin/s3fs  (It means s3fs has been installed)

Step2: – 
Now create one S3 user in IAM and provide S3fullaccess role to user.

Note:- S3FS utility need a valid user and its credentials when it goes to S3 services (background process). So we have to store user’s credentials in a file on the system.

  •  #vim /etc/passwd-s3fs
  • Your_Access_Key:Your_Secret_Key

EX: –AKIATFXYI56N7EW3LTC2(ACCESS KEY ID):0qdKHk6HfSmVgahZGQmy9JSdUT8XlnD4rH3crcSe(SECRET KEY ID) 

  • #chmod 600 /etc/passwd-s3fs
  • #mkdir /s3bucket
  • #s3fs -o passwd_file=/etc/passwd-s3fs
  • #df -Th

For permanent mounting

  • #echo “s3fs# / fuse _netdev,rw,nosuid,nodev,allow_other,nonempty 0 0” >> /etc/fstab
  • #cat /etc/fstab
With the same process you can mount more then one bucket as well.
For collecting the system logs or uploading/downloading you can schedule crontab jobs itself.