I know how to shut down an EC2 instance that's idle, with this : https://aws.amazon.com/about-aws/whats-new/2013/01/08/use-amazon-cloudwatch-to-detect-and-shut-down-unused-amazon-ec2-instances/
However, the other side of the coin is, if there are any incoming requests to the server (via domain name / IP) then Route 53 needs to trigger something that restarts the server, IF the server is currently stopped.
NOTE : this needs to be a RESTART (start from stopped) and NOT a REBOOT.
How do I accomplish this?
Many thanks!