Command line utility for simple AWS EC2 provisioning and backups
Disclaimer: This utility was built in 2016, way before I discovered HashiCorp's excellent tool, Terraform, which I highly recommend.
python 2.7.6
pip
- AWS Access Key ID, AWS Secret Access Key.
-
Step 1: Run the following command and follow the prompts.
aws configure
This will ask you for your:
-
AWS Access Key ID
-
AWS Secret Access Key
-
Default Region Name (eg.: ap-south-1)
-
Default Output Format (Press Enter to choose None)
-
References:
-
-
Step 2: Install requirements (preferably, in a virtual environment)
pip install -r requirements.txt
-
Step 3: Install saw (from project's root directory)
python setup.py install
saw launch --name INSTANCE_NAME ... [--id=IMAGE_ID]
saw publish --source SOURCE_INSTANCE_NAME --dest DEST_INSTANCE_NAME
saw backup --id INSTANCE_ID --name IMAGE_NAME [--desc=DESCRIPTION]
saw images [filter --name=IMAGE_NAME]
saw instances [filter [--state=INSTANCE_STATE] [--image=IMAGE_NAME]
[--name=INSTANCE_NAME] [--user=USER]]
saw elastic_ips
saw -h | --help
Command | Description |
---|---|
launch | Launches new EC2 instance(s) |
publish | Publish to production from staging instance |
backup | Create backup AMI Image from EC2 Instance |
instances | Lists all instances in current region |
images | Lists all images owned by you |
elastic_ips | Lists all Elastic IPs |
filter | Apply filter on resource |