AWS Elastic Beanstalk Deployment

I’m currently running an EC2 instance outside the Elastic Beanstalk which includes a bunch of PHP files/folders. I want this app to be in the Elastic Beanstalk so I created a new Elastic Beanstalk environment which automatically launched a new EC2 instance.

1) Do I have to save all my PHP files/folders in a zip file and upload & deploy?

2) If I change a file, do I have to re-zip and upload (eg. no FTP)? (This will be time consuming since I have 500MB of images).

3) Should I only use the Elastic Beanstalk when my app is final and continue using an EC2 instance outside it for easy FTP and changes?

Answers


1) Do I have to save all my PHP files/folders in a zip file and upload & deploy?

Yes. But this can be abstracted away. I recommend using the EB CLI. The CLI will do the zipping, uploading, and updating for you by simply typing eb deploy.

2) If I change a file, do I have to re-zip and upload (eg. no FTP)? (This will be time consuming since I have 500MB of images).

Currently elastic beanstalk only supports full zips. So you would have to upload the whole thing every time. The EB CLI will upload your zip with multiple threads and it shouldn't take to long unless you have a slow net connection. That being said, I highly recommend you put all your images and assets in s3 and cloudfront, then use Ajax to load them into you're app. This will do two things for you.

  1. Your application version (.zip file) will be reasonably small, so deploys will be fast and painless.
  2. The images will load for your end user much faster.

Also, it's worth noting that the maximum allowed size of an application version is 512M, so if you add any images, you soon won't be able to deploy.

3) Should I only use the Elastic Beanstalk when my app is final and continue using an EC2 instance outside it for easy FTP and changes?

Your decision. But you should know that beanstalk has a lot of features built around development and promoting to prod. A typical elastic beanstalk flow would be to do development locally. Then, once a feature is done, deploy to a development environment. Test it, make sure it works, then check-in. Once your app is in a prod state you can do a cname swap with your prod environment (eb swap) for zero down-time deployments.


You have multiple ways to deploy your php application to Elastic Beanstalk. You can use the AWS CLI. ( For Java you also can use Eclipse with AWS plugin, I'm not sure if it works with php too, but worth a check.)

This is a good source for you: Develop, Test, and Deploy - Beanstalk

No hands on experience on this, but the .NET plugin is able to do incremental deployment, so you have good chances for that with PHP. ( So you won't upload all your images again.)

Fro production, I really support the HA Beanstalk setup, I used it for .NET and Java environments. Gives you a lots of good features, so you don't need to deal with all the operational details.


Need Your Help

app.post not working node.js

node.js express pug

I am new to node and I wanted to try a simple app.post but I can't get it to work. my app.js and index.jade code is shown below. I am trying to get my app to print "hi" to the console when I enter ...

How to link_to a page and activate a tab content on that page?

jquery ruby-on-rails link-to

I'm trying to link from one page directly to a specific tab on another page. I can get to the other page, but can't figure out how to get to the specific tab. has anyone done this?