I have a jenkins ubuntu server and several windows nodes running on ec2. I'd like for the server to turn the windows boxes on and off as they're needed. I think that means using the "launch method" in the node config, but I'm not sure what to write.
I currently have Launch Method set to "by connecting it to the master", and have to have a step at the start of my pipeline to call
aws ec2 start-instances --instance-ids XXX to start the instance, and the equivalent stop-instances when completing the pipeline, but this means every job turns the machines on and off, even if there's another job queued.
I could maybe put the aws command into the node config, but I only have one command box. I can't put in one command to turn it off and another to turn it on.
Is there a plugin to help here? Or a way to set up the aws call to make this work? Am I even right that launch method is the box I want?