I need to start up an EC2 instance at (say) 6am every day. The constraints are that I\'d like to avoid having a computer running all day to do the startup or use a paid solu
I just faced the same problem and solved it by using Autoscaling just as many of the answers here mentioned. The only thing you need for that is an AMI image that you want to run and the Autoscaling API command-line tools.
After you downloaded the tools, follow the instructions in the readme to set the environmental variables and add your AWS credentials. Than put the following commands in a batch file (this example is for Windows):
as-create-launch-config --key "MYLAUNCHCONFIGNAME" --instance-type t1.micro --image-id MYAMI-IMAGEID --launch-config "MYLAUNCHCONFIGNAME"
as-create-auto-scaling-group --auto-scaling-group "MYSCALINGGROUPNAME" --launch-configuration "MYLAUNCHCONFIGNAME" --availability-zones "us-east-1a,us-east-1b,us-east-1c,us-east-1d" --min-size 0 --max-size 0
rem Don't restart instance after shutdown
as-suspend-processes "MYSCALINGGROUPNAME" --processes ReplaceUnhealthy
rem Start instance at 22:15
as-put-scheduled-update-group-action --name "startMyInstance" --auto-scaling-group "MYSCALINGGROUPNAME" --min-size 1 --max-size 1 --recurrence "15 22 * * *"
rem Stop instance at 23:05
as-put-scheduled-update-group-action --name "stopMyInstance" --auto-scaling-group "MYSCALINGGROUPNAME" --min-size 0 --max-size 0 --recurrence "05 23 * * *"
Replace the capitalized names with some of your choice and set the correct AMI-ID for your AMI image. A new instance based on your AMI image will start at 22:15 and terminate at 23:05. Of course you can also change the instance type and availability zone(s).