diff --git a/main.tf b/main.tf index 9696c453..564221c2 100644 --- a/main.tf +++ b/main.tf @@ -168,7 +168,8 @@ resource "aws_autoscaling_group" "gitlab_runner_instance" { min_size = "1" max_size = "1" desired_capacity = "1" - health_check_grace_period = 0 + health_check_grace_period = var.runner_instance.health_check_grace_period + health_check_type = var.runner_instance.health_check_type max_instance_lifetime = var.runner_instance.max_lifetime_seconds enabled_metrics = var.runner_instance.collect_autoscaling_metrics diff --git a/variables.tf b/variables.tf index b1c84570..e180aa29 100644 --- a/variables.tf +++ b/variables.tf @@ -119,12 +119,16 @@ variable "runner_instance" { spot_price = By setting a spot price bid price the Runner is created via a spot request. Be aware that spot instances can be stopped by AWS. Choose \"on-demand-price\" to pay up to the current on demand price for the instance type chosen. ssm_access = Allows to connect to the Runner via SSM. type = EC2 instance type used. + health_check_type = The health check type for the Runner manager ASG. Valid values are "EC2" or "ELB". When set to "ELB", attach a target group to the ASG and configure an application-level health check (e.g. the Prometheus /metrics endpoint on port 9252). + health_check_grace_period = Time in seconds after instance comes into service before checking health. Only relevant when health_check_type is "ELB". use_eip = Assigns an EIP to the Runner. EOT type = object({ additional_tags = optional(map(string)) collect_autoscaling_metrics = optional(list(string), null) ebs_optimized = optional(bool, true) + health_check_grace_period = optional(number, 0) + health_check_type = optional(string, "EC2") max_lifetime_seconds = optional(number, null) monitoring = optional(bool, true) name = string