Skip to content

Commit 8cdfa6a

Browse files
committed
Define iam_overrides var in multi_runners module
1 parent 703763f commit 8cdfa6a

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

modules/multi-runner/runners.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ module "runners" {
100100
create_service_linked_role_spot = each.value.runner_config.create_service_linked_role_spot
101101

102102
runner_iam_role_managed_policy_arns = each.value.runner_config.runner_iam_role_managed_policy_arns
103+
iam_overrides = each.value.runner_config.iam_overrides
103104

104105
ghes_url = var.ghes_url
105106
ghes_ssl_verify = var.ghes_ssl_verify

modules/multi-runner/variables.tf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,17 @@ variable "multi_runner_config" {
162162
lambda_timeout = optional(number, 30)
163163
max_attempts = optional(number, 1)
164164
}), {})
165+
iam_overrides = optional(object({
166+
override_instance_profile = optional(bool, null)
167+
instance_profile_name = optional(string, null)
168+
override_runner_role = optional(bool, null)
169+
runner_role_arn = optional(string, null)
170+
}), {
171+
override_instance_profile = false
172+
instance_profile_name = null
173+
override_runner_role = false
174+
runner_role_arn = null
175+
})
165176
})
166177
matcherConfig = object({
167178
labelMatchers = list(list(string))
@@ -233,6 +244,7 @@ variable "multi_runner_config" {
233244
block_device_mappings: "The EC2 instance block device configuration. Takes the following keys: `device_name`, `delete_on_termination`, `volume_type`, `volume_size`, `encrypted`, `iops`, `throughput`, `kms_key_id`, `snapshot_id`."
234245
job_retry: "Experimental! Can be removed / changed without trigger a major release. Configure job retries. The configuration enables job retries (for ephemeral runners). After creating the instances a message will be published to a job retry queue. The job retry check lambda is checking after a delay if the job is queued. If not the message will be published again on the scale-up (build queue). Using this feature can impact the rate limit of the GitHub app."
235246
pool_config: "The configuration for updating the pool. The `pool_size` to adjust to by the events triggered by the `schedule_expression`. For example you can configure a cron expression for week days to adjust the pool to 10 and another expression for the weekend to adjust the pool to 1. Use `schedule_expression_timezone` to override the schedule time zone (defaults to UTC)."
247+
iam_overrides: "Allows to (optionally) override the instance profile and runner role created by the module. Set `override_instance_profile` to true and provide the `instance_profile_name` to use an existing instance profile. Set `override_runner_role` to true and provide the `runner_role_arn` to use an existing role for the runner instances."
236248
}
237249
matcherConfig: {
238250
labelMatchers: "The list of list of labels supported by the runner configuration. `[[self-hosted, linux, x64, example]]`"

0 commit comments

Comments
 (0)