Pushing to an existing AWS Elastic Beanstalk application from the command line

amazon-elastic-beanstalk, amazon-web-services, python

Solution

To begin using `git aws.push` for your application you will have to initialize your git repository with AWS Beanstalk metadata. I'm assuming you are using git for version control (if you are not, you will have to initialize your project with `git init` first).

$ cd angrywhopper
$ git init #optional
$ eb init
...
$ git aws.push

Walk through wizard steps, commit your code and push the app.

Elastic Beanstalk container can be further customized by either rerunning `eb init` or with configuration file inside .ebextensions directory.

If `eb` does not support something you would like to use, have a look at AWS Elastic Beanstalk API Command Line Interface, which is more feature-rich.

More details on the configuration can be found in the following guides:

- Customizing and Configuring AWS Elastic Beanstalk Environments

- Customizing and Configuring a Python Container

Make sure that service region in eb wizard is the same as region you pick in dashboard dropdown.

NB: I would suggest to use temporary name in the beginning to make sure your app works as expected with the new workflow and then rename it to the original by rerunning `eb init`. Don't forget to terminate the temporary environment as soon as you done with the migration to avoid any unnecessary fees.

Problem

I've used the web dashboard of Elastic Beanstalk to make an application and an environment. I know I can update that using the dashboard and uploading a zip file of my application, but I would rather use the command line to upload my application. Apparently the correct tool for this is `eb`, the CLI for Elastic Beanstalk. I've installed this and attempted to use it, following the Amazon "Deploying a Flask Application to AWS Elastic Beanstalk" tutorial. However, this seems to create a completely different application to the one visible on the EB dashboard - changes made to it don't appear on the dashboard, and the application even has a different URL. How can I use the command line to access an existing application on AWS Elastic Beanstalk?

Original source