terraform-aws-gitlab-runner
terraform-aws-gitlab-runner copied to clipboard
Pass an EIP to the EC2 instance created
In some cases when using spot, I'd like to be able to provide an EIP and reuse them in case the spot is terminated.
This is useful to prevent changing inbound rules that uses the runner's public IP as a source in their inbound rule.
@bsuv feel free to propose a PR. I use the runners in a private subnet, so no public ones are attached.
I will work on a PR. The issue with having them in a private subnet is that the NAT Gateway costs can become prohibitive
related issue #92
I've started working on this issue: https://github.com/roock/terraform-aws-gitlab-runner/commit/c204e4ba3a0427eedb1386a214bda31d1c287306 ~i t is working when enabling the use of EIP, but for disabling the feature I need a way to reference a non existing object (aws_eip is only create if the flag is set)~ seems to work fine, tested with runner on public subnet with and without flag enabled @npalm what do you think?
@roock do not hard code region and please do rebase from upstream and open PR
@kostyrev ups, thx for the hint
Assignment of EIP to the Runner server itself was added in #161 and #165. Not sure if it is possible to add support for EIPs for the docker-machine servers though.
@roock seems not supported by the aws docker machine driver https://docs.docker.com/machine/drivers/aws/
A possibility would be to use the user_data to assign an EIP to the docker-machine instances.
Is it really necessary to expose the runners? You could also access your machines via AWS Console (SSM access). Seems to be easier to configure and less risky.
If we are talking about the agent: There should be an inbound rule which allows traffic from your Gitlab instance only. And the communicatin agent <-> runner should be safeguarded through the module itself using security groups.
We should be fine without an EIP at all or do I miss something? Any other use case?
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 15 days.
This issue was closed because it has been stalled for 15 days with no activity.