Script to control EC2 instances via AWS HTTP API

Hey folks!

I wrote a bunch of code to issue start/stop/status commands to EC2 instances. I had to patch crypto-js (I think) and port some AWS example code from python, but it worked in the end! In my setup I’ve hooked this up with Shortcuts so I can both tap a button from the Today extension, but also just say “hey siri start the server”

I’m posting this to share the code in case anyone else comes to this forum looking for AWS related stuff (like I did originally), but also because I’d like to expand the functionality and am looking for collaborators : -)

Starting and stopping is nice but what I really want to do is launch spot instances on demand. Using the AWS API directly is really cumbersome, if anyone has any prior experience with this or any example code with some pointers it would be greatly appreciated!

Thanks for sharing this. I‘m often working with EC2 instances and this sounds super cool :smiley:

Cheers! I’ve had this same functionality available for a while now, but before I had a basic lambda do the aws stuff. It’s way more convenient this way!