Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 439
Matthew Avatar asked Dec 08 '13 06:12

Matthew


People also ask

Can you SSH into Elastic Beanstalk?

You can view a list of Amazon EC2 instances running your AWS Elastic Beanstalk application environment through the Elastic Beanstalk console. You can connect to the instances using any SSH client. You can connect to the instances running Windows using Remote Desktop.

Which command is used to view the Elastic Beanstalk events that are using AWS CLI?

The EB CLI is a command line interface for AWS Elastic Beanstalk that provides interactive commands that simplify creating, updating and monitoring environments from a local repository. Use the EB CLI as part of your everyday development and testing cycle as an alternative to the Elastic Beanstalk console.


1 Answers

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.

like image 147
kukido Avatar answered Oct 06 '22 00:10

kukido