Forked from mikepfeiffer/gist:3851e3bd95591e0675aa4c76cd57635f
Created
May 9, 2019 00:36
-
-
Save test-amir/ebcc5021d34a74697d9ec96f4acfdaa8 to your computer and use it in GitHub Desktop.
AWS Lambda Function to Start an EC2 Instance
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
| var AWS = require('aws-sdk'); | |
| exports.handler = function(event, context) { | |
| var ec2 = new AWS.EC2({region: 'us-east-1'}); | |
| ec2.startInstances({InstanceIds : ['i-0114833f8ffc9151c'] },function (err, data) { | |
| if (err) console.log(err, err.stack); | |
| else console.log(data); | |
| context.done(err,data); | |
| }); | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment