AWS S3FS How to
<p>Here's the current scenario - <br/></p>

<p>I have <strong>multiple S3 Buckets</strong>, which have SQS events configured for PUTs of Objects from a FTP, which I have configured using S3FS.</p>

<p>Also, I have <strong>multiple Directories on an EC2</strong>, on which a User can PUT an object, which gets synced with the different S3 buckets (using S3FS), which generate SQS events(using S3's SQS events).<br/><br/></p>

<p><strong>Here's what I need to achieve,<br/></strong></p>

<p><strong>Instead of Multiple S3 buckets, I need to consolidate the logic on Folder level</strong>,<br/>
ie. I have now created Different Folders for each Bucket that I had created previously, I have created separate SQS events for PUT in individual Folders.</p>

<p>Now the Bucket level logic of S3FS, I want to tweak for Folder level in a Single S3 bucket.</p>

<p>ie. I want to create 3 different Directories oon the EC2, eg A,B,C. <br/>
<strong>If I PUT an object in Directory A of the EC2, the object must get synced with Folder A in the S3 bucket</strong>, <br/>
Similarly for Directory B and folder B of S3 and Directory C on EC2 and Folder C on the S3.<br/><br/></p>

<p>Here are the steps I created for installing S3FS - <br/>
<strong>Steps -</strong> <br/></p>

<ol>
<li><p>ssh into the EC2 </p></li>
<li><p>sudo apt-get install automake autotools-dev g++ git libcurl4-gnutls-dev libfuse-dev libssl-dev libxml2-dev make pkg-config</p></li>
<li><p>git clone <a href="https://github.com/s3fs-fuse/s3fs-fuse.git" rel="nofollow">https://github.com/s3fs-fuse/s3fs-fuse.git</a></p></li>
<li><p>cd s3fs-fuse</p></li>
<li><p>./autogen.sh</p></li>
<li><p>./configure</p></li>
<li><p>make</p></li>
<li><p>sudo make install</p></li>
</ol>

<p><strong>Mounting S3 Bucket to File System</strong><br/></p>

<ol start="9">
<li><p>echo <strong>access-key-id:secret-access-key</strong> > /etc/passwd-s3fs </p></li>
<li><p>chmod 600 /etc/passwd-s3fs</p></li>
<li><p>mkdir /mnt/<strong>bucketname</strong></p></li>
<li><p>echo s3fs#<strong>bucketname</strong> /mnt/<strong>bucketname</strong> fuse _netdev,rw,nosuid,nodev,allow_other 0 0 >> /etc/fstab </p></li>
<li><p>mount -a</p></li>
</ol>

<p>Now these steps achieve sync between a particular Directory on the EC2 and the S3 bucket,<br/>
How do I tweak this to sync say 2 different Directories on the EC2 with 2 different Folders on the S3.<br/>
I am a Linux and AWS newbie, Please help me out.</p>