How to get the new runner registration to work with AWS Spot ASG

The new way of registering runners to gitlab which is register the runner first in gitlab UI and use the register command to create that runner is a bit confusing when we are using AWS auto scaling where instances would come and go. It’s not scalable to added a runner first in the UI and copy the token to the newly created ec2 and register it. Is there a way to automate it, on all the related examples with the new method I only see a single runner registered all the time. what if I want to add 100 ec2 spot runners using the new way would look like?

For Runners which are the same (like you have in ASG) you can re-use the “new” (authentication) token instead of the old registration token. The new tokens can be used by more instances of runner.