machulav / ec2-github-runner

On-demand self-hosted AWS EC2 runner for GitHub Actions
MIT License
745 stars 331 forks source link

Assign a name to a newly created instance #203

Open gtr opened 1 week ago

gtr commented 1 week ago

Thanks for creating this workflow! Found it super useful for hosting my integration tests on AWS!

Perhaps I'm missing something but is it not possible to assign a name to an instance of an EC2 runner when it spins up? I have this AMI that I'm spinning up instances from but every time I check the "EC2 Instances" page on the AWS console, the "name" field for the newly created instance is empty. I would've thought that the label input would've gave it a name.

Is this already supported? If not, can there be a new input -- something like ec2-instance-name: -- which would assign a name to the newly created EC2 instance so that we know who spun up the EC2 instance and what branch they were on? Thanks.

stecullum commented 20 hours ago

Just set the name tag..

         aws-resource-tags: > # optional, requires additional permissions
            [
              {"Key": "Name", "Value": "gha-demo-${{ github.repository }}-${{github.run_number}}"},
              {"Key": "GitHubRepository", "Value": "${{ github.repository }}"}
            ]
       This names my instances in the EC2 console