diff --git a/README.md b/README.md index 6961705c2c..39ab510b56 100644 --- a/README.md +++ b/README.md @@ -412,8 +412,9 @@ In case the setup does not work as intended follow the trace of events: | [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 | | [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 | | [enable\_organization\_runners](#input\_enable\_organization\_runners) | Register runners to organization, instead of repo level | `bool` | `false` | no | +| [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 | | [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 | -| [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 | +| [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 | | [environment](#input\_environment) | A name that identifies the environment, used as prefix and for tagging. | `string` | n/a | yes | | [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 | | [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 --git a/main.tf b/main.tf index 6620da3fcf..8f507db462 100644 --- a/main.tf +++ b/main.tf @@ -151,6 +151,7 @@ module "runners" { enable_job_queued_check = var.enable_job_queued_check disable_runner_autoupdate = var.disable_runner_autoupdate enable_managed_runner_security_group = var.enable_managed_runner_security_group + enable_runner_detailed_monitoring = var.enable_runner_detailed_monitoring scale_down_schedule_expression = var.scale_down_schedule_expression minimum_running_time_in_minutes = var.minimum_running_time_in_minutes runner_boot_time_in_minutes = var.runner_boot_time_in_minutes diff --git a/modules/runners/README.md b/modules/runners/README.md index a7a79ce2ed..4df4291115 100644 --- a/modules/runners/README.md +++ b/modules/runners/README.md @@ -127,6 +127,7 @@ yarn run dist | [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 | | [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 | | [enable\_organization\_runners](#input\_enable\_organization\_runners) | n/a | `bool` | n/a | yes | +| [enable\_runner\_detailed\_monitoring](#input\_enable\_runner\_detailed\_monitoring) | Enable detailed monitoring for runners | `bool` | `false` | no | | [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 | | [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 | | [environment](#input\_environment) | A name that identifies the environment, used as prefix and for tagging. | `string` | n/a | yes | diff --git a/modules/runners/main.tf b/modules/runners/main.tf index 036b23f91d..a3407e8e89 100644 --- a/modules/runners/main.tf +++ b/modules/runners/main.tf @@ -81,6 +81,10 @@ resource "aws_launch_template" "runner" { } } + monitoring { + enabled = var.enable_runner_detailed_monitoring + } + iam_instance_profile { name = aws_iam_instance_profile.runner.name } diff --git a/modules/runners/variables.tf b/modules/runners/variables.tf index 45bda6115d..04dbd3b2e2 100644 --- a/modules/runners/variables.tf +++ b/modules/runners/variables.tf @@ -415,6 +415,12 @@ variable "kms_key_arn" { default = null } +variable "enable_runner_detailed_monitoring" { + description = "Enable detailed monitoring for runners" + type = bool + default = false +} + variable "egress_rules" { description = "List of egress rules for the GitHub runner instances." type = list(object({ diff --git a/variables.tf b/variables.tf index 969795dde5..4ce3a653d6 100644 --- a/variables.tf +++ b/variables.tf @@ -165,8 +165,14 @@ variable "kms_key_arn" { default = null } +variable "enable_runner_detailed_monitoring" { + 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." + type = bool + default = false +} + variable "enabled_userdata" { - description = "Should the userdata script be enabled for the runner. Set this to false if you are using your own prebuilt AMI" + description = "Should the userdata script be enabled for the runner. Set this to false if you are using your own prebuilt AMI." type = bool default = true }