Reputation: 84
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?
Upvotes: 1
Views: 1953
Reputation: 8376
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.)
For production, I really support the HA Beanstalk setup, I used it for .NET and Java environments. It provides you a lots of good features, so you don't need to deal with all the operational details.
Upvotes: 0
Reputation: 15755
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.
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.
Upvotes: 3