One gitlab tag multiple servers

Hi Team,
Could you please let me know if there is a way push code to multiple ec2 instances using one gitlab runner tag.

Is this script-based example approach that uses some value pass-and-parse to work in an iteration what you are after?

If not, could you please clarify your request with what you’ve done so far and what limitation you’re running into?

Hello @hchouraria , Thanks for replying back, I have used a similar script which was used for deploying to multiple ec2 instances, but recently the client came back and said that going forward, port 22 will be blocked. So , I then installed gitlab runners (shell type executor) and registered them against the project and used them to copy the code onto the servers, but now the Infra team is creating an AMI image of the ec2 instance , which includes a registered gitlab runner tag and then make it part of an auto scaling group.
Hence my question, regarding the deployment, if at any point in time there are 3 instances running with the same Gitlab runner tag, will my code be deployed to all 3 instances or just one instance depending on which ec2 instance get’s picked up first. How do i ensure my code get’s deployed on all the instances part of the auto scaling group.Please suggest any solutions. Thanks