I'm wondering if it is possible fo upload a zip of my entire application to Elastic Beanstalk through CLI? Currently I'm using git aws.push, but the problem is that my app has vendor dependencies I need to install after deploy. If I could directly upload a zip from CLI I could get my jenkins build server to install all the vendors, zip up the entire app then upload to EBS.
1 Answers
You have this tagged as "Elastic Beanstalk", so I'm going to assume that you're trying to push your app to S3, not EBS. App versions are stored in a S3 bucket and the Beanstalk deployment script then downloads the .zip from the bucket to the EBS volume, extracts it in /tmp
, and then copies over the code to /var/www/html
. You don't actually ever upload anything directly to the EBS volume (well, I mean, you shouldn't).
If your dependencies are PHP libraries, just include them with your application source bundle. However, if your dependencies include files that are installed in a location other than /var/www/html
(like Apache modules or other binaries), then no, you can't (easily) do that with Elastic Beanstalk and PHP during deployment. You'll have to SSH in, install your dependencies, "burn" a custom AMI of the instance, and then specify that custom AMI in your Beanstalk environment config.
This is somewhat of an ugly workaround because you now have the responsibility of maintaining this custom AMI, whereas using the stock Amazon-provided images means you can rely on them to periodically release new versions with security fixes, etc. Keep in mind though that the AWS product development teams move at breakneck speed. Just a couple weeks ago the Beanstalk team introduced Puppet-like configuration scripts for provisioning. This is likely exactly what you'd need, but unfortunately it only supports Java and Python environments. I expect them to release PHP support soon though, so keep an eye on it.

- 9,847
- 14
- 48
- 63
-
Thanks for the response, yep, I meant pushing up to s3, I can do that fine but I get stuck with getting it to show up as a version in the ebs console. My deps are all composer installed vendors, I created a grunt task on my computer server to zip everything up as one package and push up to s3,works well but I just need to solve the adding it as a version issue. – greg Oct 20 '12 at 15:52
-
@greg Did you ever find a solution to uploading the zip to S3 via CLI and have it show up as a version?! – TheStoryCoder May 20 '19 at 20:53