Skip to content

Commit 6bfe648

Browse files
feat: add license_specification
1 parent cead47f commit 6bfe648

7 files changed

Lines changed: 28 additions & 4 deletions

File tree

main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ module "runners" {
208208
credit_specification = var.runner_credit_specification
209209
cpu_options = var.runner_cpu_options
210210
placement = var.runner_placement
211+
license_specification = var.runner_license_specification
211212

212213
enable_runner_binaries_syncer = var.enable_runner_binaries_syncer
213214
lambda_s3_bucket = var.lambda_s3_bucket

modules/multi-runner/runners.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ module "runners" {
5656
credit_specification = each.value.runner_config.credit_specification
5757
cpu_options = each.value.runner_config.cpu_options
5858
placement = each.value.runner_config.placement
59+
license_specification = each.value.runner_config.license_specification
5960

6061
enable_runner_binaries_syncer = each.value.runner_config.enable_runner_binaries_syncer
6162
lambda_s3_bucket = var.lambda_s3_bucket

modules/multi-runner/variables.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,9 @@ variable "multi_runner_config" {
147147
tenancy = optional(string)
148148
partition_number = optional(number)
149149
}), null)
150+
license_specification = optional(object({
151+
license_configuration_arn = string
152+
}), null)
150153
runner_log_files = optional(list(object({
151154
log_group_name = string
152155
prefix_log_group = bool

modules/runners/main.tf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,13 @@ resource "aws_launch_template" "runner" {
190190
}
191191
}
192192

193+
dynamic "license_specification" {
194+
for_each = var.license_specification != null ? [var.license_specification] : []
195+
content {
196+
license_configuration_arn = license_specification.value.license_configuration_arn
197+
}
198+
}
199+
193200
monitoring {
194201
enabled = var.enable_runner_detailed_monitoring
195202
}

modules/runners/templates/user-data-osx.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
#!/bin/bash -e
22

3-
exec > >(tee /var/log/user-data.log | logger -t user-data -s 2>/dev/console) 2>&1
4-
5-
# macOS user-data for GitHub Actions runners
6-
73
set +x
84

95
%{ if enable_debug_logging }

modules/runners/variables.tf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -671,6 +671,14 @@ variable "placement" {
671671
default = null
672672
}
673673

674+
variable "license_specification" {
675+
description = "The license specifications for the instance. See https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/launch_template#license_specification for details."
676+
type = object({
677+
license_configuration_arn = string
678+
})
679+
default = null
680+
}
681+
674682
variable "enable_jit_config" {
675683
description = "Overwrite the default behavior for JIT configuration. By default JIT configuration is enabled for ephemeral runners and disabled for non-ephemeral runners. In case of GHES check first if the JIT config API is available. In case you are upgrading from 3.x to 4.x you can set `enable_jit_config` to `false` to avoid a breaking change when having your own AMI."
676684
type = bool

variables.tf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -902,6 +902,14 @@ variable "runner_placement" {
902902
default = null
903903
}
904904

905+
variable "runner_license_specification" {
906+
description = "The license specifications for the instance. See https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/launch_template#license_specification for details."
907+
type = object({
908+
license_configuration_arn = string
909+
})
910+
default = null
911+
}
912+
905913
variable "enable_jit_config" {
906914
description = "Overwrite the default behavior for JIT configuration. By default JIT configuration is enabled for ephemeral runners and disabled for non-ephemeral runners. In case of GHES check first if the JIT config API is available. In case you are upgrading from 3.x to 4.x you can set `enable_jit_config` to `false` to avoid a breaking change when having your own AMI."
907915
type = bool

0 commit comments

Comments
 (0)