How can i access/download current application in AWS Elastic Beanstalk?

Viewed 310

i have a website where users can upload images. my question is is there any simple way to access/download the current application i deployed in Elastic Beanstalk and access the files that the users uploaded?

because i can't keep "Upload & Deploy" each time i make changes in the code and loose all the images the users have uploaded. please bare with me i'm a complete newbie with all this (explain briefly plzz).

1 Answers

i make changes in the code and loose all the images the users have uploaded

This is bad practice leading to issues, one of which you are describing. If you want to follow good practices, you should keep your images outside of EB instance. Usually this is done by keeping them in S3 bucket or EFS filesystem.

my question is is there any simple way to access/download the current application i deployed in Elastic Beanstalk and access the files that the users uploaded?

But if you really want to store the images the way you do, then you have to SSH into your EB instance and copy the files to safe place (e.g. S3 bucket) manually. You application is located in /var/app/current.

You could also develop an automation for that, using .ebextentions scripts.

Nevertheless, your way of storing the images will only lead to issues in the long term. So maybe its good chance to re-architect your design now, before it will be too late.

Related