I am using user-data to register my EC2 as a self-hosted GH Action runner as follows
su - ubuntu -c './config.sh --unattended --url '${github_repo_url}' \
--pat '${github_pat}' --name '${name}' --labels '${labels}' --replace'
(no output, just the command-line)
I am using a GitHub (GH) Personal Access Token (PAT) since otherwise I would have to go to the GH webinterface (UI) and request a registration token each time I want to register a new AWS EC2 virtual machine instance as self-hosted GH runner.
The problem is that user-data is of course visible once the machine is ready.
Is there a better way to go about it?
AFAIK EC2 do not accept resource-based policies so as to restrict access to only a selected group of members.