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

Commit e73a267

Browse files
authored
feat: Add option to enable detailed monitoring for runner launch template (#2024)
* Expose detailed monitoring config for runners `enable_runner_detailed_monitoring` exposes the explicit enabling or disabling of detailed monitoring (1 minute increments vs default 5 minute increments) for the runner EC2 launch template. * Automatic README update
1 parent d3cf753 commit e73a267

File tree

6 files changed

+21
-2
lines changed

6 files changed

+21
-2
lines changed

Diff for: README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -408,8 +408,9 @@ In case the setup does not work as intended follow the trace of events:
408408
| <a name="input_enable_job_queued_check"></a> [enable\_job\_queued\_check](#input\_enable\_job\_queued\_check) | Only scale if the job event received by the scale up lambda is is in the state queued. By default enabled for non ephemeral runners and disabled for ephemeral. Set this variable to overwrite the default behavior. | `bool` | `null` | no |
409409
| <a name="input_enable_managed_runner_security_group"></a> [enable\_managed\_runner\_security\_group](#input\_enable\_managed\_runner\_security\_group) | Enabling the default managed security group creation. Unmanaged security groups can be specified via `runner_additional_security_group_ids`. | `bool` | `true` | no |
410410
| <a name="input_enable_organization_runners"></a> [enable\_organization\_runners](#input\_enable\_organization\_runners) | Register runners to organization, instead of repo level | `bool` | `false` | no |
411+
| <a name="input_enable_runner_detailed_monitoring"></a> [enable\_runner\_detailed\_monitoring](#input\_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. | `bool` | `false` | no |
411412
| <a name="input_enable_ssm_on_runners"></a> [enable\_ssm\_on\_runners](#input\_enable\_ssm\_on\_runners) | Enable to allow access the runner instances for debugging purposes via SSM. Note that this adds additional permissions to the runner instances. | `bool` | `false` | no |
412-
| <a name="input_enabled_userdata"></a> [enabled\_userdata](#input\_enabled\_userdata) | Should the userdata script be enabled for the runner. Set this to false if you are using your own prebuilt AMI | `bool` | `true` | no |
413+
| <a name="input_enabled_userdata"></a> [enabled\_userdata](#input\_enabled\_userdata) | Should the userdata script be enabled for the runner. Set this to false if you are using your own prebuilt AMI. | `bool` | `true` | no |
413414
| <a name="input_environment"></a> [environment](#input\_environment) | A name that identifies the environment, used as prefix and for tagging. | `string` | n/a | yes |
414415
| <a name="input_fifo_build_queue"></a> [fifo\_build\_queue](#input\_fifo\_build\_queue) | Enable a FIFO queue to remain the order of events received by the webhook. Suggest to set to true for repo level runners. | `bool` | `false` | no |
415416
| <a name="input_ghes_ssl_verify"></a> [ghes\_ssl\_verify](#input\_ghes\_ssl\_verify) | GitHub Enterprise SSL verification. Set to 'false' when custom certificate (chains) is used for GitHub Enterprise Server (insecure). | `bool` | `true` | no |

Diff for: main.tf

+1
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ module "runners" {
151151
enable_job_queued_check = var.enable_job_queued_check
152152
disable_runner_autoupdate = var.disable_runner_autoupdate
153153
enable_managed_runner_security_group = var.enable_managed_runner_security_group
154+
enable_runner_detailed_monitoring = var.enable_runner_detailed_monitoring
154155
scale_down_schedule_expression = var.scale_down_schedule_expression
155156
minimum_running_time_in_minutes = var.minimum_running_time_in_minutes
156157
runner_boot_time_in_minutes = var.runner_boot_time_in_minutes

Diff for: modules/runners/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ yarn run dist
127127
| <a name="input_enable_job_queued_check"></a> [enable\_job\_queued\_check](#input\_enable\_job\_queued\_check) | Only scale if the job event received by the scale up lambda is is in the state queued. By default enabled for non ephemeral runners and disabled for ephemeral. Set this variable to overwrite the default behavior. | `bool` | `null` | no |
128128
| <a name="input_enable_managed_runner_security_group"></a> [enable\_managed\_runner\_security\_group](#input\_enable\_managed\_runner\_security\_group) | Enabling the default managed security group creation. Unmanaged security groups can be specified via `runner_additional_security_group_ids`. | `bool` | `true` | no |
129129
| <a name="input_enable_organization_runners"></a> [enable\_organization\_runners](#input\_enable\_organization\_runners) | n/a | `bool` | n/a | yes |
130+
| <a name="input_enable_runner_detailed_monitoring"></a> [enable\_runner\_detailed\_monitoring](#input\_enable\_runner\_detailed\_monitoring) | Enable detailed monitoring for runners | `bool` | `false` | no |
130131
| <a name="input_enable_ssm_on_runners"></a> [enable\_ssm\_on\_runners](#input\_enable\_ssm\_on\_runners) | Enable to allow access to the runner instances for debugging purposes via SSM. Note that this adds additional permissions to the runner instances. | `bool` | n/a | yes |
131132
| <a name="input_enabled_userdata"></a> [enabled\_userdata](#input\_enabled\_userdata) | Should the userdata script be enabled for the runner. Set this to false if you are using your own prebuilt AMI | `bool` | `true` | no |
132133
| <a name="input_environment"></a> [environment](#input\_environment) | A name that identifies the environment, used as prefix and for tagging. | `string` | n/a | yes |

Diff for: modules/runners/main.tf

+4
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ resource "aws_launch_template" "runner" {
8181
}
8282
}
8383

84+
monitoring {
85+
enabled = var.enable_runner_detailed_monitoring
86+
}
87+
8488
iam_instance_profile {
8589
name = aws_iam_instance_profile.runner.name
8690
}

Diff for: modules/runners/variables.tf

+6
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,12 @@ variable "kms_key_arn" {
409409
default = null
410410
}
411411

412+
variable "enable_runner_detailed_monitoring" {
413+
description = "Enable detailed monitoring for runners"
414+
type = bool
415+
default = false
416+
}
417+
412418
variable "egress_rules" {
413419
description = "List of egress rules for the GitHub runner instances."
414420
type = list(object({

Diff for: variables.tf

+7-1
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,14 @@ variable "kms_key_arn" {
165165
default = null
166166
}
167167

168+
variable "enable_runner_detailed_monitoring" {
169+
description = "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."
170+
type = bool
171+
default = false
172+
}
173+
168174
variable "enabled_userdata" {
169-
description = "Should the userdata script be enabled for the runner. Set this to false if you are using your own prebuilt AMI"
175+
description = "Should the userdata script be enabled for the runner. Set this to false if you are using your own prebuilt AMI."
170176
type = bool
171177
default = true
172178
}

0 commit comments

Comments
 (0)