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
903 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
• 94,990 points
111 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
• 94,990 points
96 views
+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
538 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
• 7,320 points
175 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
750 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 May 29, 2020 in DevOps on Cloud by Sirajul
• 58,950 points
143 views