Skip to content

Commit

Permalink
feat: Add ebs_optimized option (#3492)
Browse files Browse the repository at this point in the history
Fixes:
https://github.com/philips-labs/terraform-aws-github-runner/issues/2988

Adds ebs_optimized parameter for ec2 instances.

Currently this defaults to false to keep it in line with the previous
behavior.

---------

Co-authored-by: Niek Palm <[email protected]>
  • Loading branch information
pbarnajc and npalm authored Sep 22, 2023
1 parent 1fad99d commit bf73f1c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions modules/multi-runner/runners.tf
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ module "runners" {

sqs_build_queue = { "arn" : each.value.arn }
github_app_parameters = local.github_app_parameters
ebs_optimized = each.value.runner_config.ebs_optimized
enable_organization_runners = each.value.runner_config.enable_organization_runners
enable_ephemeral_runners = each.value.runner_config.enable_ephemeral_runners
enable_jit_config = each.value.runner_config.enable_jit_config
Expand Down
2 changes: 2 additions & 0 deletions modules/multi-runner/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ variable "multi_runner_config" {
credit_specification = optional(string, null)
delay_webhook_event = optional(number, 30)
disable_runner_autoupdate = optional(bool, false)
ebs_optimized = optional(bool, false)
enable_ephemeral_runners = optional(bool, false)
enable_job_queued_check = optional(bool, null)
enable_organization_runners = optional(bool, false)
Expand Down Expand Up @@ -140,6 +141,7 @@ variable "multi_runner_config" {
credit_specification: "(Optional) The credit specification of the runner instance_type. Can be unset, `standard` or `unlimited`.
delay_webhook_event: "The number of seconds the event accepted by the webhook is invisible on the queue before the scale up lambda will receive the event."
disable_runner_autoupdate: "Disable the auto update of the github runner agent. Be aware there is a grace period of 30 days, see also the [GitHub article](https://github.blog/changelog/2022-02-01-github-actions-self-hosted-runners-can-now-disable-automatic-updates/)"
ebs_optimized: "The EC2 EBS optimized configuration."
enable_ephemeral_runners: "Enable ephemeral runners, runners will only be used once."
enable_job_queued_check: "Enables JIT configuration for creating runners instead of registration token based registraton. JIT configuration will only be applied for ephemeral runners. By default JIT confiugration is enabled for ephemeral runners an can be disabled via this override. When running on GHES without support for JIT configuration this variable should be set to true for ephemeral runners."
enable_organization_runners: "Register runners to organization, instead of repo level"
Expand Down
1 change: 1 addition & 0 deletions modules/runners/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ resource "aws_launch_template" "runner" {
instance_initiated_shutdown_behavior = "terminate"
image_id = data.aws_ami.runner.id
key_name = var.key_name
ebs_optimized = var.ebs_optimized

vpc_security_group_ids = compact(concat(
var.enable_managed_runner_security_group ? [aws_security_group.runner_sg[0].id] : [],
Expand Down
6 changes: 6 additions & 0 deletions modules/runners/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,12 @@ variable "block_device_mappings" {
}]
}

variable "ebs_optimized" {
description = "The EC2 EBS optimized configuration."
type = bool
default = false
}

variable "instance_target_capacity_type" {
description = "Default lifecyle used runner instances, can be either `spot` or `on-demand`."
type = string
Expand Down

0 comments on commit bf73f1c

Please sign in to comment.