machulav / ec2-github-runner

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

[Feature Request] Add Support for Assigning Elastic IP to EC2 Instances #198

Open akumar-99 opened 4 months ago

akumar-99 commented 4 months ago

Feature Request: I am currently using a GitHub Action workflow to test a website (domain hosted in Cloudflare and secured by Zero Trust). To allow access, I add specific IPs to the allow list. However, there is no current functionality to attach an Elastic IP (EIP) to the EC2 instance created using this action. This feature would be beneficial as it would allow us to use a static IP in our AWS account, which could then be provided as input to the action. Upon creation, the machine would have this Elastic IP assigned, allowing me to add it to Cloudflare’s IP allow list.

Proposed Solution: Add a parameter to the GitHub Action that accepts an Elastic IP from the user’s AWS account.

Considerations: One contingency to consider is the scenario where multiple workflows run simultaneously. As an Elastic IP can only be associated with one EC2 instance at a time, concurrent workflows may result in failures. I recommend implementing logic to handle or queue workflows that require the same Elastic IP.

crohr commented 1 month ago

@akumar-99 not sure if you've fixed your issue since you posted, but RunsOn has support for static IPs (even concurrently) when launching runners in private subnets - https://runs-on.com/networking/static-ips/.