machulav / ec2-github-runner

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

Instance role when added not working #132

Open maheshevizio opened 1 year ago

maheshevizio commented 1 year ago

I have added the additional permissions in the role as documented but it keeps throwing this error

Run machulav/ec2-github-runner@v2 (https://github.com/ad-tech/pocs/actions/runs/4020315401/jobs/6908102164#step:4:23) GitHub Registration Token is received 23 Error: AWS EC2 instance starting error 24 Error: InvalidParameterValue: Value (GithubActionRunner) for parameter iamInstanceProfile.name is invalid. Invalid IAM Instance Profile name 25 Error: Value (GithubActionRunner) for parameter iamInstanceProfile.name is invalid. Invalid IAM Instance Profile name

maheshevizio commented 1 year ago

The runner creation works without instance-role

rernst76 commented 1 year ago

It seems like it is actually expecting an InstanceProfile, not a role. You can use the CLI to create an InstanceProfile for a given role. Then in your start job, use the instance profile name (not the ARN) and it should work!