Skip to content

Instantly share code, notes, and snippets.

@djandyr
Last active August 29, 2015 14:23
Show Gist options
  • Save djandyr/783d404b9028c6d837bb to your computer and use it in GitHub Desktop.
Save djandyr/783d404b9028c6d837bb to your computer and use it in GitHub Desktop.
Elastic Beanstalk OSX

Installing Elastic Beanstalk Command Line Interface on MacOSX.

Install Python 2.7 from homebrew, make sure openssl is installed first (otherwise you will get errors with the importing hashlib).

brew install openssl
brew link openssl --force
brew install python --with-brewed-openssl
brew link python --force

You may get a permission error linking the python 2.7 in /usr/local/Framework with homebrew. To fix change the owner on the '/usr/local/Framework' and link again.

sudo mkdir /usr/local/Framework
sudo chown -R $USER:admin /usr/local/Framework
brew link python

Install AWB EB CLI

curl -s https://s3.amazonaws.com/elasticbeanstalk-cli-resources/install-ebcli.py | python

Init Elastic Beanstalk environment, you will need the AWS access key, secret key - the root key containing this information would of been generated, and should be stored somewhere safe

eb init

You can deploy your instance after making changes.

eb deploy

Notes

You may experience issues with using homebrew python and the EB CLI install script, as this script uses pip install --user which is disabled for brewed Python due to a bug in distutils. This results in the following error :

error: can't combine user with with prefix

https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/Homebrew-and-Python.md#note-on-pip-install---user

As a result, the quickest way to fix would be to manually download the python 2.7 from http://www.python.org, uninstall homebrewed python, and rerun the EB CLI install script.

brew uninstall python

Install Python 2.7 package (eg. https://www.python.org/ftp/python/2.7.10/python-2.7.10-macosx10.6.pkg)

curl -s https://s3.amazonaws.com/elasticbeanstalk-cli-resources/install-ebcli.py | python

You may get a error symlinking eb to /usr/local/bin, to fix :

sudo ln -s ~/.ebvenv/bin/eb /usr/local/bin/eb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment