Skip to content

Commit

Permalink
feat: add support for matcher config tiering options
Browse files Browse the repository at this point in the history
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 <brend.smits@philips.com>
  • Loading branch information
Brend-Smits committed Jun 28, 2024
1 parent ef25bd4 commit 8eb100e
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 2 deletions.
3 changes: 2 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ module "webhook" {
}
}
}
sqs_workflow_job_queue = length(aws_sqs_queue.webhook_events_workflow_job_queue) > 0 ? aws_sqs_queue.webhook_events_workflow_job_queue[0] : null
matcher_config_parameter_store_tier = var.matcher_config_parameter_store_tier
sqs_workflow_job_queue = length(aws_sqs_queue.webhook_events_workflow_job_queue) > 0 ? aws_sqs_queue.webhook_events_workflow_job_queue[0] : null

github_app_parameters = {
webhook_secret = module.ssm.parameters.github_app_webhook_secret
Expand Down
10 changes: 10 additions & 0 deletions modules/multi-runner/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -644,3 +644,13 @@ variable "instance_termination_watcher" {
})
default = {}
}

variable "matcher_config_parameter_store_tier" {
description = "The tier of the parameter store for the matcher configuration. Valid values are `Standard`, `Advanced`, and `Intelligent-Tiering`."
type = string
default = "Standard"
validation {
condition = contains(["Standard", "Advanced", "Intelligent-Tiering"], var.matcher_config_parameter_store_tier)
error_message = "`matcher_config_parameter_store_tier` value is not valid, valid values are: `Standard`,`Advanced`, and `Intelligent-Tiering`."
}
}
3 changes: 2 additions & 1 deletion modules/multi-runner/webhook.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ module "webhook" {
tags = local.tags
kms_key_arn = var.kms_key_arn

runner_matcher_config = local.runner_config
runner_matcher_config = local.runner_config
matcher_config_parameter_store_tier = var.matcher_config_parameter_store_tier
ssm_paths = {
root = local.ssm_root_path
webhook = var.ssm_paths.webhook
Expand Down
1 change: 1 addition & 0 deletions modules/webhook/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,5 @@ resource "aws_ssm_parameter" "runner_matcher_config" {
name = "${var.ssm_paths.root}/${var.ssm_paths.webhook}/runner-matcher-config"
type = "String"
value = jsonencode(local.runner_matcher_config_sorted)
tier = var.matcher_config_parameter_store_tier
}
10 changes: 10 additions & 0 deletions modules/webhook/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -194,3 +194,13 @@ variable "ssm_paths" {
webhook = string
})
}

variable "matcher_config_parameter_store_tier" {
description = "The tier of the parameter store for the matcher configuration. Valid values are `Standard`, `Advanced`, and `Intelligent-Tiering`."
type = string
default = "Standard"
validation {
condition = contains(["Standard", "Advanced", "Intelligent-Tiering"], var.matcher_config_parameter_store_tier)
error_message = "`matcher_config_parameter_store_tier` value is not valid, valid values are: `Standard`,`Advanced`, and `Intelligent-Tiering`."
}
}
9 changes: 9 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,15 @@ variable "enable_runner_workflow_job_labels_check_all" {
default = true
}

variable "matcher_config_parameter_store_tier" {
description = "The tier of the parameter store for the matcher configuration. Valid values are `Standard`, `Advanced`, and `Intelligent-Tiering`."
type = string
default = "Standard"
validation {
condition = contains(["Standard", "Advanced", "Intelligent-Tiering"], var.matcher_config_parameter_store_tier)
error_message = "`matcher_config_parameter_store_tier` value is not valid, valid values are: `Standard`,`Advanced`, and `Intelligent-Tiering`."
}
}
variable "runner_ec2_tags" {
description = "Map of tags that will be added to the launch template instance tag specifications."
type = map(string)
Expand Down

0 comments on commit 8eb100e

Please sign in to comment.