Temporary AWS files before uploading to S3?

My Laravel app allows users to upload images. Currently, when a user uploads their images, they are stored in a temporary location on the server. The cron job then modifies the uploaded images (compresses them, etc.) and uploads them to S3. Any temporary files older than 48 hours that are not uploaded to S3 are removed by another cron job.

I created an Elastic Beanstalk environment, but it occurred to me that storing uploaded images in a temporary instance directory is risky because instances can be created and destroyed as needed.

How and where will I store these temporary files so they are not at risk of being deleted?

+3


source to share


1 answer


As discussed in the comments, I think uploading a file to S3 is the best option. As far as I know, it is impossible to stop Elastic Beanstalk from destroying an ec2 instance unless you want to get rid of all scaling and instance / autocorrect capabilities.



One option that I don't know much about might be AWS EBS. "Amazon Elastic Block Store (Amazon EBS) provides persistent block storage for use with Amazon EC2 instances in the AWS Cloud." I have no direct experience with EBS, the main question will of course be if EBS is truly rackable, even after the ec2 instance is destroyed. Since EBS has an overhead associated with this, it looks like since you are already using S3 S3 will be the way to go.

+1


source







All Articles