Skip to content
This repository was archived by the owner on Jan 16, 2025. It is now read-only.

Commit 5f9d9eb

Browse files
feat: add support for matcher config tiering options (#3953)
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. ⚠️ **It should be noted that if you changed the parameter store tier for the matcher config manually, this change might override your changes!** Signed-off-by: Brend Smits <[email protected]> --------- Signed-off-by: Brend Smits <[email protected]> Co-authored-by: forest-pr|bot <forest-pr[bot]@users.noreply.github.com>
1 parent ef25bd4 commit 5f9d9eb

File tree

9 files changed

+37
-2
lines changed

9 files changed

+37
-2
lines changed

Diff for: README.md

+1
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ Talk to the forestkeepers in the `runners-channel` on Slack.
179179
| <a name="input_log_level"></a> [log\_level](#input\_log\_level) | Logging level for lambda logging. Valid values are 'silly', 'trace', 'debug', 'info', 'warn', 'error', 'fatal'. | `string` | `"info"` | no |
180180
| <a name="input_logging_kms_key_id"></a> [logging\_kms\_key\_id](#input\_logging\_kms\_key\_id) | Specifies the kms key id to encrypt the logs with. | `string` | `null` | no |
181181
| <a name="input_logging_retention_in_days"></a> [logging\_retention\_in\_days](#input\_logging\_retention\_in\_days) | Specifies the number of days you want to retain log events for the lambda log group. Possible values are: 0, 1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180, 365, 400, 545, 731, 1827, and 3653. | `number` | `180` | no |
182+
| <a name="input_matcher_config_parameter_store_tier"></a> [matcher\_config\_parameter\_store\_tier](#input\_matcher\_config\_parameter\_store\_tier) | The tier of the parameter store for the matcher configuration. Valid values are `Standard`, and `Advanced`. | `string` | `"Standard"` | no |
182183
| <a name="input_metrics_namespace"></a> [metrics\_namespace](#input\_metrics\_namespace) | The namespace for the metrics created by the module. Merics will only be created if explicit enabled. | `string` | `"GitHub Runners"` | no |
183184
| <a name="input_minimum_running_time_in_minutes"></a> [minimum\_running\_time\_in\_minutes](#input\_minimum\_running\_time\_in\_minutes) | The time an ec2 action runner should be running at minimum before terminated, if not busy. | `number` | `null` | no |
184185
| <a name="input_pool_config"></a> [pool\_config](#input\_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 weekdays to adjust the pool to 10 and another expression for the weekend to adjust the pool to 1. | <pre>list(object({<br> schedule_expression = string<br> size = number<br> }))</pre> | `[]` | no |

Diff for: 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

Diff for: modules/multi-runner/README.md

+1
Large diffs are not rendered by default.

Diff for: 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+
}

Diff for: 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

Diff for: modules/webhook/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ No modules.
9191
| <a name="input_log_level"></a> [log\_level](#input\_log\_level) | Logging level for lambda logging. Valid values are 'silly', 'trace', 'debug', 'info', 'warn', 'error', 'fatal'. | `string` | `"info"` | no |
9292
| <a name="input_logging_kms_key_id"></a> [logging\_kms\_key\_id](#input\_logging\_kms\_key\_id) | Specifies the kms key id to encrypt the logs with | `string` | `null` | no |
9393
| <a name="input_logging_retention_in_days"></a> [logging\_retention\_in\_days](#input\_logging\_retention\_in\_days) | Specifies the number of days you want to retain log events for the lambda log group. Possible values are: 0, 1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180, 365, 400, 545, 731, 1827, and 3653. | `number` | `180` | no |
94+
| <a name="input_matcher_config_parameter_store_tier"></a> [matcher\_config\_parameter\_store\_tier](#input\_matcher\_config\_parameter\_store\_tier) | The tier of the parameter store for the matcher configuration. Valid values are `Standard`, and `Advanced`. | `string` | `"Standard"` | no |
9495
| <a name="input_prefix"></a> [prefix](#input\_prefix) | The prefix used for naming resources | `string` | `"github-actions"` | no |
9596
| <a name="input_repository_white_list"></a> [repository\_white\_list](#input\_repository\_white\_list) | List of github repository full names (owner/repo\_name) that will be allowed to use the github app. Leave empty for no filtering. | `list(string)` | `[]` | no |
9697
| <a name="input_role_path"></a> [role\_path](#input\_role\_path) | The path that will be added to the role; if not set, the environment name will be used. | `string` | `null` | no |

Diff for: 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
}

Diff for: 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+
}

Diff for: 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)