deploy ebs - apigee-127/a127-documentation GitHub Wiki

Deploy to Elastic Beanstalk

Note: To do these steps, you'll need an Amazon Web Services account and access to Elastic Beanstalk. Follow the AWS documentation for details.

Elastic Beanstalk lets you upload and deploy Node.js (and other kinds of) applications to the Amazon Web Services (AWS) cloud. If you have an AWS Elastic Beanstalk account, it's easy to deploy your a127 project there. In this scenario, EB serves as the Node.js container where your a127 project runs.

  1. Create an a127 "account" where you specify AWS as the deployment target. We'll name the account aws-target.

    a127 account create aws-target
    

    Note: An a127 account is little more than a file with information about a deployment target. It's not an account in the sense that you must sign up or register for something. The account information is stored, by default, in ~/.a127/accounts.

  2. Follow the prompts and specify amazon as the provider:

        a127 account create aws-target
        [?] Provider? amazon
        Account aws-target
        ==================
        provider: amazon
    
        done
    
  3. Now, be sure to select the account, making it the active account:

    a127 account select aws-target
    
  4. Verify that the account is selected:

    a127 account show
    
    Account
    =======
    provider: amazon
    name: aws-target
    
  5. Run the deploy command (from the root directory):

    a127 project deploy
    

A .zip file is saved in the deployments directory. You can now upload and deploy this zip file to Elastic Beanstalk. See the EB docs for specific import instructions.

For example, if you deploy your project to an EB environment called quotatutorial-env, you could call it like this:

curl -i http://quotatutorial-env.elasticbeanstalk.com/weather?city=Niwot,CO