Upload Files to Amazon AWS

amazon ec2amazon-ebsamazon-web-services

I am new to Amazon AWS and fairly new to Web hosting in general. I previously used Bluehost for web hosting, but my company is switching to AWS. I'm wondering what the best practices are for uploading php, html, and css files. We are constantly adding and tweaking the pages on our site and I need to know how to fit this into the AWS way of doing things.

Previously we simply used an FTP client to change the files on our server. Now I used Elastic Beanstalk to set up our stack, and have figured out how to use the FTP program to upload files to an EC2 volume using SFTP. However, when a new Instance gets launched, it does not contain the most recent changes.

I know that with Elastic Beanstalk I could upload a new version, but I don't really want to have to zip-up, upload, and deploy a new version of all my files, even if I've made just one small change.

We are not hosting a static website. We make pretty heavy use of a MySQL database to generate and change pages.

Are there better options out there? Ideally, I would have one place to keep my php etc files and any running instances would get the files from there.

Any help, direction, tutorials are much appreciated. Thanks

Best Answer

You can do couple of different things here.

  1. First is, using a different storage instead, like using S3, where you store all your files and upload the latest files over there.

    S3 is more like a network storage. You can upload your files there and then access them from different instances.

  2. Second option is that you use the EC2 command line tools, create a new AMI whenever you change the files, and use the new AMI to launch new instances. By this case you will always have the latest data.

    So, when a new Instance in launched in ElasticBeanStalk, it uses a default AMI, but you can create new AMI and configure to use the new AMI. So, you can make scripts which will create a new AMI as soon as you are done with changes and delete the old one and use this AMI to launch a new instance.

  3. Third options is, as told by ceejayoz, you can use EC2 instances instead of ElasticBeanStalk and customize it according to your needs.

I usually prefer the third option, as I want to customize things on my own, and want the control of the whole system, software etc. But that's just me. You can go for any of the above options.