Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- import boto.ec2
- conn = boto.ec2.connect_to_region('us-west-1', aws_access_key_id=YOUR_KEY, aws_secret_access_key=YOUR_SECRET_KEY)
- script = '''#!/bin/bash
- apt-get update
- apt-get install git-core
- # clone, whatever
- '''
- print conn.run_instances(
- image_id = 'ami-19bfef5c',
- key_name = 'dev',
- security_groups = ['dev', 'dev-mattb'],
- user_data = script,
- instance_type = 'm1.small',
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement