$ pip install awsebcli

$ pip install virualenv

$ wget http://web2py.com/examples/static/web2py_src.zip

$ virtualenv eb-virt

$ source eb-virt/bin/activate

(eb-virt)$ mkdir ebweb2py

(eb-virt)$ cd ebweb2py

(eb-virt)$ pip freeze > requirements.txt

(eb-virt)$ deactivate

$ unzip ../web2py_src.zip

$ web2py/handlers/wsgihandler.py web2py

$ mkdir .ebextensions

$ echo <<EOF

option_settings:

  aws:elasticbeanstalk:container:python:

    WSGIPath: web2py/wsgihandler.py

EOF > .ebextensions/web2py.config



At thi point the folder structure should be

ebweb2py:

  .ebextensions/

     web2py.config

  requirements.txt

  web2py/

    wsgihandler.py

    web2py.py

    ...



$ eb init -p python2.7 web2py-tutorial



Get security credentials from https://console.aws.amazon.com/iam/home#security_credential

(specifically a pair of aws-access-id and aws-secret-key).



$ eb init

You have not yet set up your credentials or your credentials are incorrect

You must provide your credentials.

(aws-access-id): [...]

(aws-secret-key): [...]

...

Type a keypair name.

(Default is aws-eb): [...]

Generating public/private rsa key pair.

Enter passphrase (empty for no passphrase): [...]



$ eb create web2py-env

$ eb open