diff --git a/README.md b/README.md index 8eadd5a3af..12ab464a70 100644 --- a/README.md +++ b/README.md @@ -179,6 +179,7 @@ Talk to the forestkeepers in the `runners-channel` on Slack. | [log\_level](#input\_log\_level) | Logging level for lambda logging. Valid values are 'silly', 'trace', 'debug', 'info', 'warn', 'error', 'fatal'. | `string` | `"info"` | no | | [logging\_kms\_key\_id](#input\_logging\_kms\_key\_id) | Specifies the kms key id to encrypt the logs with. | `string` | `null` | no | | [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 | +| [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 | | [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 | | [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 | | [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. |
list(object({| `[]` | no | diff --git a/main.tf b/main.tf index 1617b10d41..c0c92562c0 100644 --- a/main.tf +++ b/main.tf @@ -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 diff --git a/modules/multi-runner/README.md b/modules/multi-runner/README.md index 719b94299b..c480cdb1bf 100644 --- a/modules/multi-runner/README.md +++ b/modules/multi-runner/README.md @@ -147,6 +147,7 @@ module "multi-runner" { | [log\_level](#input\_log\_level) | Logging level for lambda logging. Valid values are 'silly', 'trace', 'debug', 'info', 'warn', 'error', 'fatal'. | `string` | `"info"` | no | | [logging\_kms\_key\_id](#input\_logging\_kms\_key\_id) | Specifies the kms key id to encrypt the logs with | `string` | `null` | no | | [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 | +| [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 | | [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 | | [multi\_runner\_config](#input\_multi\_runner\_config) | multi\_runner\_config = {
schedule_expression = string
size = number
}))
map(object({| n/a | yes | | [pool\_lambda\_reserved\_concurrent\_executions](#input\_pool\_lambda\_reserved\_concurrent\_executions) | Amount of reserved concurrent executions for the scale-up lambda function. A value of 0 disables lambda from being triggered and -1 removes any concurrency limitations. | `number` | `1` | no | diff --git a/modules/multi-runner/variables.tf b/modules/multi-runner/variables.tf index efdbfd82d0..f99382ddc8 100644 --- a/modules/multi-runner/variables.tf +++ b/modules/multi-runner/variables.tf @@ -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`, and `Advanced`." + type = string + default = "Standard" + validation { + condition = contains(["Standard", "Advanced"], var.matcher_config_parameter_store_tier) + error_message = "`matcher_config_parameter_store_tier` value is not valid, valid values are: `Standard`, and `Advanced`." + } +} diff --git a/modules/multi-runner/webhook.tf b/modules/multi-runner/webhook.tf index 96bcbdbc3e..430a014b5b 100644 --- a/modules/multi-runner/webhook.tf +++ b/modules/multi-runner/webhook.tf @@ -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 diff --git a/modules/webhook/README.md b/modules/webhook/README.md index de6ba34a6b..7ee19b00ea 100644 --- a/modules/webhook/README.md +++ b/modules/webhook/README.md @@ -91,6 +91,7 @@ No modules. | [log\_level](#input\_log\_level) | Logging level for lambda logging. Valid values are 'silly', 'trace', 'debug', 'info', 'warn', 'error', 'fatal'. | `string` | `"info"` | no | | [logging\_kms\_key\_id](#input\_logging\_kms\_key\_id) | Specifies the kms key id to encrypt the logs with | `string` | `null` | no | | [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 | +| [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 | | [prefix](#input\_prefix) | The prefix used for naming resources | `string` | `"github-actions"` | no | | [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 | | [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 --git a/modules/webhook/main.tf b/modules/webhook/main.tf index 503332b563..777972f826 100644 --- a/modules/webhook/main.tf +++ b/modules/webhook/main.tf @@ -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 } diff --git a/modules/webhook/variables.tf b/modules/webhook/variables.tf index c350b67c2a..759e0784cc 100644 --- a/modules/webhook/variables.tf +++ b/modules/webhook/variables.tf @@ -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`, and `Advanced`." + type = string + default = "Standard" + validation { + condition = contains(["Standard", "Advanced"], var.matcher_config_parameter_store_tier) + error_message = "`matcher_config_parameter_store_tier` value is not valid, valid values are: `Standard`, and `Advanced`." + } +} diff --git a/variables.tf b/variables.tf index 0389b005b3..0337d55b92 100644 --- a/variables.tf +++ b/variables.tf @@ -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`, and `Advanced`." + type = string + default = "Standard" + validation { + condition = contains(["Standard", "Advanced"], var.matcher_config_parameter_store_tier) + error_message = "`matcher_config_parameter_store_tier` value is not valid, valid values are: `Standard`, and `Advanced`." + } +} variable "runner_ec2_tags" { description = "Map of tags that will be added to the launch template instance tag specifications." type = map(string)
runner_config = object({
runner_os = string
runner_architecture = string
runner_metadata_options = optional(map(any), {
instance_metadata_tags = "enabled"
http_endpoint = "enabled"
http_tokens = "required"
http_put_response_hop_limit = 1
})
ami_filter = optional(map(list(string)), { state = ["available"] })
ami_owners = optional(list(string), ["amazon"])
ami_id_ssm_parameter_name = optional(string, null)
ami_kms_key_arn = optional(string, "")
create_service_linked_role_spot = optional(bool, false)
credit_specification = optional(string, null)
delay_webhook_event = optional(number, 30)
disable_runner_autoupdate = optional(bool, false)
ebs_optimized = optional(bool, false)
enable_ephemeral_runners = optional(bool, false)
enable_job_queued_check = optional(bool, null)
enable_on_demand_failover_for_errors = optional(list(string), [])
enable_organization_runners = optional(bool, false)
enable_runner_binaries_syncer = optional(bool, true)
enable_ssm_on_runners = optional(bool, false)
enable_userdata = optional(bool, true)
instance_allocation_strategy = optional(string, "lowest-price")
instance_max_spot_price = optional(string, null)
instance_target_capacity_type = optional(string, "spot")
instance_types = list(string)
job_queue_retention_in_seconds = optional(number, 86400)
minimum_running_time_in_minutes = optional(number, null)
pool_runner_owner = optional(string, null)
runner_as_root = optional(bool, false)
runner_boot_time_in_minutes = optional(number, 5)
runner_extra_labels = optional(list(string), [])
runner_group_name = optional(string, "Default")
runner_name_prefix = optional(string, "")
runner_run_as = optional(string, "ec2-user")
runners_maximum_count = number
runner_additional_security_group_ids = optional(list(string), [])
scale_down_schedule_expression = optional(string, "cron(*/5 * * * ? *)")
scale_up_reserved_concurrent_executions = optional(number, 1)
userdata_template = optional(string, null)
userdata_content = optional(string, null)
enable_jit_config = optional(bool, null)
enable_runner_detailed_monitoring = optional(bool, false)
enable_cloudwatch_agent = optional(bool, true)
cloudwatch_config = optional(string, null)
userdata_pre_install = optional(string, "")
userdata_post_install = optional(string, "")
runner_ec2_tags = optional(map(string), {})
runner_iam_role_managed_policy_arns = optional(list(string), [])
vpc_id = optional(string, null)
subnet_ids = optional(list(string), null)
idle_config = optional(list(object({
cron = string
timeZone = string
idleCount = number
evictionStrategy = optional(string, "oldest_first")
})), [])
runner_log_files = optional(list(object({
log_group_name = string
prefix_log_group = bool
file_path = string
log_stream_name = string
})), null)
block_device_mappings = optional(list(object({
delete_on_termination = optional(bool, true)
device_name = optional(string, "/dev/xvda")
encrypted = optional(bool, true)
iops = optional(number)
kms_key_id = optional(string)
snapshot_id = optional(string)
throughput = optional(number)
volume_size = number
volume_type = optional(string, "gp3")
})), [{
volume_size = 30
}])
pool_config = optional(list(object({
schedule_expression = string
size = number
})), [])
})
matcherConfig = object({
labelMatchers = list(list(string))
exactMatch = optional(bool, false)
priority = optional(number, 999)
})
fifo = optional(bool, false)
redrive_build_queue = optional(object({
enabled = bool
maxReceiveCount = number
}), {
enabled = false
maxReceiveCount = null
})
}))