In this post, we will be using Ebextension to mount the EFS in Elastic beanstalk.
Clone the project locally to your linux machine.
Copy the ebxtenstion as .ebxtenstion in your core code and upload a same in your AWS Elastic Beanstalk.
cp -r ebxtenstion <path_to_your_application>/.ebxtenstion
Add the below Environment properties in you Elastic Beanstalk.
key | value |
---|---|
EFS_NAME | <efs_dns_name> |
- Install nfs-utils and jq for the mounting purpose.
- Simple bash script to mount the efs to /mnt/efs/uploads
- Removing the /var/app/ondeck/wp-content/uploads directory.
- Link the /var/app/ondeck/wp-content/uploads to /mnt/efs/uploads