Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

executable file 13 lines (8 sloc) 0.323 kb
1 2 3 4 5 6 7 8 9 10 11 12
#!/bin/sh -ex
# EC2 will tell us our own instance ID, use that to turn ourselves off.

python <<KILL

from urllib import urlopen
from boto.ec2 import EC2Connection

instance = urlopen('http://169.254.169.254/latest/meta-data/instance-id').read().strip()
EC2Connection('$KEY', '$SECRET').terminate_instances(instance)

KILL
Something went wrong with that request. Please try again.