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

Commit cdaa950

Browse files
authored
feat: support for cloudwatch config on per runner for multi-runners (#3447)
## Problem Cloud config can only set for all multi-runners and not per runner. ## Solution Add option to set the cloud config per runner.
1 parent 83c3e5d commit cdaa950

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

Diff for: modules/multi-runner/runners.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ module "runners" {
6969
logging_retention_in_days = var.logging_retention_in_days
7070
logging_kms_key_id = var.logging_kms_key_id
7171
enable_cloudwatch_agent = each.value.runner_config.enable_cloudwatch_agent
72-
cloudwatch_config = var.cloudwatch_config
72+
cloudwatch_config = try(coalesce(each.value.runner_config.cloudwatch_config, var.cloudwatch_config), null)
7373
runner_log_files = each.value.runner_config.runner_log_files
7474
runner_group_name = each.value.runner_config.runner_group_name
7575
runner_name_prefix = each.value.runner_config.runner_name_prefix

Diff for: modules/multi-runner/variables.tf

+2
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ variable "multi_runner_config" {
7171
enable_jit_config = optional(bool, null)
7272
enable_runner_detailed_monitoring = optional(bool, false)
7373
enable_cloudwatch_agent = optional(bool, true)
74+
cloudwatch_config = optional(string, null)
7475
userdata_pre_install = optional(string, "")
7576
userdata_post_install = optional(string, "")
7677
runner_ec2_tags = optional(map(string), {})
@@ -166,6 +167,7 @@ variable "multi_runner_config" {
166167
enable_jit_config "Overwrite the default behavior for JIT configuration. By default JIT configuration is enabled for ephemeral runners and disabled for non-ephemeral runners. In case of GHES check first if the JIT config API is avaialbe. In case you upgradeing from 3.x to 4.x you can set `enable_jit_config` to `false` to avoid a breaking change when having your own AMI."
167168
enable_runner_detailed_monitoring: "Should detailed monitoring be enabled for the runner. Set this to true if you want to use detailed monitoring. See https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-cloudwatch-new.html for details."
168169
enable_cloudwatch_agent: "Enabling the cloudwatch agent on the ec2 runner instances, the runner contains default config. Configuration can be overridden via `cloudwatch_config`."
170+
cloudwatch_config: "(optional) Replaces the module default cloudwatch log config. See https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Agent-Configuration-File-Details.html for details."
169171
userdata_pre_install: "Script to be ran before the GitHub Actions runner is installed on the EC2 instances"
170172
userdata_post_install: "Script to be ran after the GitHub Actions runner is installed on the EC2 instances"
171173
runner_ec2_tags: "Map of tags that will be added to the launch template instance tag specifications."

0 commit comments

Comments
 (0)