Advertisement
Guest User

Untitled

a guest
Sep 21st, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.47 KB | None | 0 0
  1. #!/usr/bin/env python
  2.  
  3. import boto.ec2
  4.  
  5. conn = boto.ec2.connect_to_region('us-west-1', aws_access_key_id=YOUR_KEY, aws_secret_access_key=YOUR_SECRET_KEY)
  6.  
  7. script = '''#!/bin/bash
  8.  
  9. apt-get update
  10. apt-get install git-core
  11. # clone, whatever
  12. '''
  13.  
  14. print conn.run_instances(
  15.     image_id            = 'ami-19bfef5c',
  16.     key_name            = 'dev',
  17.     security_groups     = ['dev', 'dev-mattb'],
  18.     user_data           = script,
  19.     instance_type       = 'm1.small',
  20. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement