Created
February 23, 2019 20:08
-
-
Save 100daysofdevops/21947bcdfd701e7269a4df4693a6cc62 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import boto3 | |
| # Enter the region your instances are in. Include only the region without specifying Availability Zone; 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) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment