How to mount the S3 bucket using IAM role or S3fs and use in ElasticBeanstalk

0 votes

Hi Team,

Can you please confirm how we can mount the s3 bucket into my specific folder (abc) using elasticbeanstalk. I've tried to create the .ebextensions folder and under that I've create the config file to mount the s3 bucket. BUt no luck. 

Here is the code which I've tried to use.

packages:
yum:
gcc: []
libstdc++-devel: []
gcc-c++: []
fuse: []
fuse-devel: []
libcurl-devel: []
libxml2-devel: []
openssl-devel: []
mailcap: []
automake: []
sources:
/tmp: https://github.com/s3fs-fuse/s3fs-fuse/archive/v1.78.zip
files:
"/etc/fuse.conf" :
mode: "000644"
owner: root
group: root
content: |
# mount_max = 1000
user_allow_other
"/opt/elasticbeanstalk/hooks/appdeploy/pre/11_unmount_s3fs.sh":
mode: "000755"
owner: root
group: root
content: |
#!/usr/bin/env bash
if mountpoint -q [/path/on/filesystem]; then
fusermount -u [/path/on/filesystem]
fi
"/opt/elasticbeanstalk/hooks/appdeploy/enact/02_mount_s3fs.sh":
mode: "000755"
owner: root
group: root
content: |
#!/usr/bin/env bash
. /opt/elasticbeanstalk/support/envvars
# Make sure it's mounted as the webapp user
id=`id -u webapp`
s3fs [your-bucket]:[/optional/path/in/bucket] [/path/on/filesystem] -o nonempty -o uid=$id -o gid=$id -o use_cache=/tmp -o allow_other
commands:
01_patch_s3fs:
cwd: /tmp/s3fs-fuse-1.78/src
command: "sed -i 's/AWSACCESSKEYID/AWS_ACCESS_KEY_ID/g;s/AWSSECRETACCESSKEY/AWS_SECRET_KEY/g' s3fs.cpp"
02_install_s3fs:
cwd: /tmp/s3fs-fuse-1.78
test: "[ ! -x /usr/bin/s3fs ]"
command: "autoreconf --install && export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig && ./configure --prefix=/usr && make && make install"
Sep 20, 2019 in DevOps on Cloud by rahulkathpal
• 120 points
485 views
Is it throwing any error?

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In DevOps on Cloud

+2 votes
2 answers
0 votes
2 answers
0 votes
1 answer
+2 votes
0 answers

Using .ebextensions to run commands while deploying the app in dev/uat/prod

Hey, We earlier had a plaintext credentials in ...READ MORE

Sep 10, 2019 in DevOps on Cloud by Sai
320 views
0 votes
1 answer

How to manage Application version for VM's in Azure Autoscaling group

First of all, You have to launch ...READ MORE

answered Apr 23, 2018 in DevOps on Cloud by shubham
• 6,910 points
118 views
0 votes
1 answer

How to control development/prod/staging application settings using azure functions?

You should use a build-release system like ...READ MORE

answered May 10, 2018 in DevOps on Cloud by ajs3033
• 7,280 points
527 views
0 votes
1 answer

I am looking for a python code to get my Azure VM status in my email , like whether the running vms port is open to the internet. If its open to internet I should get a mail notification

Hey, @Sourav, Check this out https://www.edureka.co/community/66025/azure-vm-monitoring It deals with ...READ MORE

answered 4 days ago in DevOps on Cloud by Sirajul
• 53,080 points
58 views
+4 votes
2 answers

unable to get subdomain of URL in NGINX

You just need to add .+ after ...READ MORE

answered Oct 11, 2018 in DevOps on Cloud by lina
• 8,200 points
1,291 views
+3 votes
2 answers
+2 votes
3 answers

How do I deploy Scala PlayFramework Project to IBM Bluemix

It seems that they are more than ...READ MORE

answered Oct 18, 2018 in DevOps on Cloud by lina
• 8,200 points
180 views