I love working with CloudFormation and automations, lastly I've created a generic Gitlab Runner
cloudformation stack, which takes 3-4 input paremeters.
What is needed if you have gitlab at work, and you cannot have Shared Runners, you create a
CloudFormation stack using Amazon Linux and CFN-Bootstrap helpers
Input parameters:
- Gitlab URL
- Gitlab Group Runner Token
- Tags
- Size of the EC2 Instance
A bit of magic using my Makefile
make cf-validate cf-package cf-deploy
I've included AutoScaling policies to add more gitlab runners when the average CPU is above 60
percent, also Scale Out and Scale In policies based on time. Still haven't figured out how to have
dynamic scaled for this use case where you have some developers to work late at night, then you want
a machine to be able to build, but maybe that is solvable by them installing a Gitlab Runner on
their own machine?