Skip to content

Instantly share code, notes, and snippets.

@drorm
Last active April 7, 2016 18:31
Show Gist options
  • Save drorm/321a41d2d89bc772a9fb64d3c20f4514 to your computer and use it in GitHub Desktop.
Save drorm/321a41d2d89bc772a9fb64d3c20f4514 to your computer and use it in GitHub Desktop.
AWS EB cheat sheet

#Initialization

#RDS

  • Log in to eb through the console and click on the dashboard for your app
  • Click on Configuration
  • Under Data Tier there should be an option to create an RDS instance. Click on it.
  • Choose the options for your db. I chose:
    • Postgres
    • 9.5.2
    • db.t2.micro Make sure to choose the correct instance size It affects how much you are charged
    • Enter the credentials
    • Launch the RDS instance.
  • It will take a little while for the instance to be active
  • You don't need to hard code the credentails in your app. Eb puts them in your environment .http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/AWSHowTo.RDS.html

#Running

  • make changes
  • git commit
  • eb deploy (no git push)
  • eb ssh to log in to the instance. The instance is volatile, meaning changing code on the fly will be overitten by the next eb deploy (not to mention when you have multiple instances).

#EB deployment

  • git repo is zipped
  • It is saved to S3 and from there to the instance(s). All the old files are removed and the new ones are unzipped
  • On a node instance the following commands are run:
    • npm install -- installs the library
    • npm start -- runs your application
  • package.json need something like the following to start the app
 "scripts": {
       "start": "node server/server.js",
  },
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment