deploy_utils
Utilities for deploying projects to EC2
Table of Contents
Documentation
For now, just look at the test code.
Installation
In Another Project
Install with pip: pip install deploy_utils or put it in your setup.py in install_requires: deploy_utils.
As Standalone
The project is based of off python 2.7, but is best used with the virtualenv development scheme.
- Install Python 2.7
- Install virtualenv:
$ [sudo] pip install virtualenv - Instantiate the virtual python environment for the project using python 2.7:
- Windows:
virtualenv --python=C:\Python27\python.exe deploy_utils - Linux:
virtualenv -p /path/to/python27 deploy_utils
- Browse to project folder
cd deploy_utils - Activate the virtualenv:
- Windows:
.\Scripts\activate - Linux:
source bin/activate
- (Windows only) Manually install the
pycryptolibrary. The followin command assumes you have 32 bit python 2.7 installed:pip install http://www.voidspace.org.uk/python/pycrypto-2.6.1/pycrypto-2.6.1-cp27-none-win32.whlIf 64 bit python 2.7 is installed, run the following command instaed:pip install http://www.voidspace.org.uk/python/pycrypto-2.6.1/pycrypto-2.6.1-cp27-none-win_amd64.whl - Install the python project using develop mode:
python setup.py develop
EC2 Notes
You will need to do the following for automatically launching Amazon EC2 instances using the scripts:
- Create AWS account
- Get the access key
- Get the secret access key
- Create a profile in
~/.aws/credentialswith the above keys - Create security group
- Add your IP to list of allowed inbound traffic (see aws docs).
- Create key pair (see aws docs).
- Download .pem file to computer
- (Windows only) instally PuTTY and PuTTYgen
- Download from here.
- Create .ppk file (see aws docs).
- AMI ids
- You need to use the appropriate one for your region
- Do this by going to the marketplace and selecting the type to use and then find the AMI id by saying you'll manually launch it.
- Use of CentOS
- Requires that you agree to some TOS, I did this by launching an instance
- This library targets CentOS 6 HVM with Updates
- Pre 2015 instance setup machine with only
rootuser - Post 2014 uses
centosuser - Includes script to automatically install PostGIS. :)
Config File Data
| Setting Name | Description |
|---|---|
| ami_id | The base ami to start from. See notes about finding AMI ids above. |
| aws_access_key_id | Access key for account. |
| aws_profile_name | The profile name where you put the keys |
| aws_secret_access_key | Secret access key for account. |
| block_device_map | Where to attach storage. Amazon Linux: /dev/xvda CentOS 6: /dev/sda1 |
| cron_email | Who to email in cron jobs. |
| key_filename | The filename of your .pem file. |
| key_pair_name | The key pair name for the EC2 instance to use. |
| instance_name | The name to tag the instance with. |
| instance_type | The EC2 instance type. (See instance types). |
| non_root_user | The non-root user ot use when fabbing on the machine. Amazon Linux: ec2-user CentOS 6: centos |
| region | The AWS region to connect to. |
| security_groups | Security groups to grant to the instance. If more than one, seperate with commas. |
| volume_size | Size of the AWS Volume for the new instance in GB. |
Metadata
Release files for deploy-utils 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| deploy_utils-1.0.1.tar.gz | 14.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| deploy_utils-1.0.1-py2-none-any.whl | Python 2 | none | any | Details |
Total release size: 32.4 kB
Release files / deploy_utils-1.0.1.tar.gz
| Download URL | deploy_utils-1.0.1.tar.gz |
|---|---|
| Size | 14.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
067fcfb33e619c83b2f0cd0ff454914c7c450c74bc59b527867f720f0b9b26a3
|
|
BLAKE2b-256 checksum How to use checksums |
e380b446701c00d520f94385ca2d3b322ed8b118615657305a836e6dc2010062
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/2.7.15
|
Release files / deploy_utils-1.0.1-py2-none-any.whl
| Download URL | deploy_utils-1.0.1-py2-none-any.whl |
|---|---|
| Size | 18.3 kB |
| Tags | Python 2 |
|
SHA-256 checksum How to use checksums |
06e7e5a66a3c008afa9e37424582eb4207dcae5a80bcf712424a36db49b80148
|
|
BLAKE2b-256 checksum How to use checksums |
a75262331ed37e0319efddbcbbd6aa9124db11534ee2a9103ff0636bfd28e681
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/2.7.15
|