Skip to content

Commit 150a798

Browse files
committed
feat: add support for matcher config tiering options
This feature is useful as a workaround when you have a larger number of runner configurations and run into problems where the parameter store limit is being reached (4KB). The limit of Standard is 4KB and Advanced is 8KB. Signed-off-by: Brend Smits <[email protected]>
1 parent ef25bd4 commit 150a798

File tree

6 files changed

+34
-2
lines changed

6 files changed

+34
-2
lines changed

main.tf

+2-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,8 @@ module "webhook" {
142142
}
143143
}
144144
}
145-
sqs_workflow_job_queue = length(aws_sqs_queue.webhook_events_workflow_job_queue) > 0 ? aws_sqs_queue.webhook_events_workflow_job_queue[0] : null
145+
matcher_config_parameter_store_tier = var.matcher_config_parameter_store_tier
146+
sqs_workflow_job_queue = length(aws_sqs_queue.webhook_events_workflow_job_queue) > 0 ? aws_sqs_queue.webhook_events_workflow_job_queue[0] : null
146147

147148
github_app_parameters = {
148149
webhook_secret = module.ssm.parameters.github_app_webhook_secret

modules/multi-runner/variables.tf

+10
Original file line numberDiff line numberDiff line change
@@ -644,3 +644,13 @@ variable "instance_termination_watcher" {
644644
})
645645
default = {}
646646
}
647+
648+
variable "matcher_config_parameter_store_tier" {
649+
description = "The tier of the parameter store for the matcher configuration. Valid values are `Standard`, and `Advanced`."
650+
type = string
651+
default = "Standard"
652+
validation {
653+
condition = contains(["Standard", "Advanced"], var.matcher_config_parameter_store_tier)
654+
error_message = "`matcher_config_parameter_store_tier` value is not valid, valid values are: `Standard`, and `Advanced`."
655+
}
656+
}

modules/multi-runner/webhook.tf

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ module "webhook" {
44
tags = local.tags
55
kms_key_arn = var.kms_key_arn
66

7-
runner_matcher_config = local.runner_config
7+
runner_matcher_config = local.runner_config
8+
matcher_config_parameter_store_tier = var.matcher_config_parameter_store_tier
89
ssm_paths = {
910
root = local.ssm_root_path
1011
webhook = var.ssm_paths.webhook

modules/webhook/main.tf

+1
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,5 @@ resource "aws_ssm_parameter" "runner_matcher_config" {
6161
name = "${var.ssm_paths.root}/${var.ssm_paths.webhook}/runner-matcher-config"
6262
type = "String"
6363
value = jsonencode(local.runner_matcher_config_sorted)
64+
tier = var.matcher_config_parameter_store_tier
6465
}

modules/webhook/variables.tf

+10
Original file line numberDiff line numberDiff line change
@@ -194,3 +194,13 @@ variable "ssm_paths" {
194194
webhook = string
195195
})
196196
}
197+
198+
variable "matcher_config_parameter_store_tier" {
199+
description = "The tier of the parameter store for the matcher configuration. Valid values are `Standard`, and `Advanced`."
200+
type = string
201+
default = "Standard"
202+
validation {
203+
condition = contains(["Standard", "Advanced"], var.matcher_config_parameter_store_tier)
204+
error_message = "`matcher_config_parameter_store_tier` value is not valid, valid values are: `Standard`, and `Advanced`."
205+
}
206+
}

variables.tf

+9
Original file line numberDiff line numberDiff line change
@@ -565,6 +565,15 @@ variable "enable_runner_workflow_job_labels_check_all" {
565565
default = true
566566
}
567567

568+
variable "matcher_config_parameter_store_tier" {
569+
description = "The tier of the parameter store for the matcher configuration. Valid values are `Standard`, and `Advanced`."
570+
type = string
571+
default = "Standard"
572+
validation {
573+
condition = contains(["Standard", "Advanced"], var.matcher_config_parameter_store_tier)
574+
error_message = "`matcher_config_parameter_store_tier` value is not valid, valid values are: `Standard`, and `Advanced`."
575+
}
576+
}
568577
variable "runner_ec2_tags" {
569578
description = "Map of tags that will be added to the launch template instance tag specifications."
570579
type = map(string)

0 commit comments

Comments
 (0)