About how to create ec2 spot instance using gitlab-ci.yml

Hello everyone

I would like to create a spot ec2 instance on aws via the gitlab-ci.yml configuration file! The objective for me is to automate this process because it must be said that I would like to create this instance to use my own runner. I first carry out the manipulation by manually creating an instance, installing all the dependencies that I would like to use, installing docker, git etc… However I would like to automate this process when a developer performs his push in order to waste a lot of time. If anyone has any suggestions for solutions, I need some help please.