Advertisement
poruchik161ru

Untitled

Feb 14th, 2017
1,538
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. import boto3
  2.  
  3. # Enter the region your instances are in, e.g. 'us-east-1'
  4.  
  5. region = 'XX-XXXXX-X'
  6.  
  7. # Enter your instances here: ex. ['X-XXXXXXXX', 'X-XXXXXXXX']
  8.  
  9. instances = ['X-XXXXXXXX']
  10.  
  11.  
  12.  
  13. def lambda_handler(event, context):
  14.  
  15. ec2 = boto3.client('ec2', region_name=region)
  16.  
  17. ec2.start_instances(InstanceIds=instances)
  18.  
  19. print 'started your instances: ' + str(instances)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement