Spotr simplifies launching, snapshotting and destroying AWS spot instances.
It's designed for users wanting to use a spot instance as a development box, and persist the state in between sessions.
First, install the library and set a default region:
$ pip install spotrNext, set up credentials and region (in e.g. ~/.aws/config):
[default]
aws_access_key_id = YOUR_KEY
aws_secret_access_key = YOUR_SECRET
region=us-west-1Then, launch an instance using:
$ spotr launch --type p2.xlarge --max-bid .30 --ami ami-4bf20033When you're done working, you can save the current state (take a snapshot) using:
$ spotr snapshotAnd then to terminate the instance:
$ spotr destroyNext time you launch an instance, leave out the --ami tag and you'll restore the most recent snapshot taken with spotr.
$ spotr launch --type p2.xlarge --max-bid .30You can specify default configurations in ~/.spotr/config:
[config]
max_bid=.30
type=p2.xlarge