Build and Deploy a Python Web App to Amazon in 30 minutes
$ curl -O http://pypi.python.org/packages/source/p/pip/pip-1.0.tar.gz $ tar xvfz pip-1.0.tar.gz $ cd pip-1.0 && python setup.py install $ pip install fabric flask boto
- Go to Amazon Web Services and Sign Up for an account.
- Currently there is a Free Tier for new customers for some instance sizes
- Create a Default Key Pair
# Sample local_settings.py # Amazon Values aws_key = 'DFGTAKIAJ4HFA' aws_secret = 'ASklKUYljkja97Kjk+adsasd/adsdssdsds' aws_key_path = '/home/foobar/.ssh/aws_keypair.pem' aws_key_pair = 'my_keypair_name' aws_security_group = 'default' # Github Value github_user = 'my_github_name'
NOTE: Whenever you deploy instances to Amazon you will be charged the hourly rate per instance type. The below command will start the clock on charges until you Stop or Terminate an instance.
$ fab deploy_web
Edit variables defined in settings.py AWS global variable to change Amazon instance size and Machine Images
'defaults' : { 'image_id' : 'ami-aecd60c7', # Amazon Linux 64-bit 'instance_type' : 't1.micro', # Micro Instance