amazon-web-servicesebcliamazon-elastic-beanstalk

How do I link a project source folder to an existing Elastic Beanstalk application?


I've been using the AWS console to upload a WAR file for deployment. Now I want to do it from the command line. I've been following this guide and see eb init and read the help with eb init --help and eb --help, but the only option is to create a new application.

usage: eb init <application_name> [options ...]

Initializes your directory with the EB CLI. Creates the application.

positional arguments:
  application_name      application name

How do I link my local source project directory to an existing application in AWS console?

I would expect a command like eb link or something, like how you can just add a Git remote with Heroku and automatically link an existing project to an existing app.


Solution

  • It worked after I got the AWS CLI keys for the project and ran aws configure. I had old keys in ~/.aws/ from a different project from perhaps a decade ago that used a different format. Once I got new keys, that were given permission for these particular apps, and ran aws configure and set the region, then eb init would present a menu of applications to choose from. The command aws elasticbeanstalk describe-applications has to work first before eb can work. I was expecting it would ask for a username and password, like Heroku does.

    Install aws and eb command line tools:

    1. Install awscli
    2. Get keys from AWS admin devops.
    3. aws configure (Example Region: 'us-east-1')
    4. aws elasticbeanstalk describe-applications
    5. Install Python
    6. pip install awsebcli --upgrade --user
    7. Add eb to your PATH, probably %USERPROFILE%\AppData\Roaming\Python\Python37\Scripts
    8. eb init
    9. eb list / eb logs / eb ssh / eb status / eb config / eb help