If you develop on an EC2 instance, it's a good practice to turn off the instance at night to save the resources. But that means you have to log into the console every morning to turn on the instance--until now!
This is a simple script that uses the Node AWS SDK to turn on a specific instance.
- Node
- Set up your AWS credentials file. This script assumes your [default] profile is where your instance is. It also assumes it's in us-west-2. Those assumptions are easy to change in the file.
- go into the file and change the instance id on line 6
node index.js
Once this command finishes the instance will be running and you should be able to ssh.