Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Network Interface Configuration to Runners Module #3585

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions modules/runners/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,17 @@ This module creates resources required to run the GitHub action runner on AWS EC

The action runners are created via a launch template; in the launch template only the subnet needs to be provided. During launch the installation is handled via a user data script. The configuration is fetched from SSM parameter store.

### Network Interface Configuration

You can control whether a public IP address should be associated with the EC2 instance using the `associate_public_ip_address` variable. Here is an example of how you can configure it:

```hcl
module "runners" {
...
associate_public_ip_address = true
...
}
```
### Lambda scale up

The scale up lambda is triggered by events on a SQS queue. Events on this queue are delayed, which will give the workflow some time to start running on available runners. For each event the lambda will check if the workflow is still queued and no other limits are reached. In that case the lambda will create a new EC2 instance. The lambda only needs to know which launch template to use and which subnets are available. From the available subnets a random one will be chosen. Once the instance is created the event is assumed as handled, and we assume the workflow wil start at some moment once the created instance is ready.
Expand Down
4 changes: 4 additions & 0 deletions modules/runners/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,10 @@ resource "aws_launch_template" "runner" {
ssm_key_cloudwatch_agent_config = var.enable_cloudwatch_agent ? aws_ssm_parameter.cloudwatch_agent_config_runner[0].name : ""
})) : ""

network_interfaces {
associate_public_ip_address = var.associate_public_ip_address
}

tags = local.tags

update_default_version = true
Expand Down
6 changes: 6 additions & 0 deletions modules/runners/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -622,3 +622,9 @@ variable "enable_jit_config" {
type = bool
default = null
}

variable "associate_public_ip_address" {
description = "Indicates whether a public IP address should be associated with the EC2 instance."
type = bool
default = true
}
Loading