Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import boto3
- # Enter the region your instances are in, e.g. 'us-east-1'
- region = 'XX-XXXXX-X'
- # Enter your instances here: ex. ['X-XXXXXXXX', 'X-XXXXXXXX']
- instances = ['X-XXXXXXXX']
- def lambda_handler(event, context):
- ec2 = boto3.client('ec2', region_name=region)
- ec2.start_instances(InstanceIds=instances)
- print 'started your instances: ' + str(instances)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement