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
2,108 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

0 votes
1 answer

How to use the pipeline setup and deploy the war file using the ansible,docker and kubernettes

Hi@Venkata, You can create an Ansible-Playbook to deploy ...READ MORE

answered Sep 1, 2020 in DevOps on Cloud by MD
• 95,460 points
1,053 views
0 votes
1 answer

How to create user and password in Windows EC2 instance using boto3 Script?

Hi, I don't think AWS will allow you ...READ MORE

answered Sep 23, 2020 in DevOps on Cloud by MD
• 95,460 points
2,255 views
+2 votes
2 answers
0 votes
2 answers
0 votes
1 answer

How to use specific node version for yarn setup in AWS deployment?

You should be able to set your ...READ MORE

answered Jul 20, 2018 in DevOps on Cloud by Kalgi
• 52,350 points
1,013 views
+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
1,300 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP