diff --git a/main.tf b/main.tf index 1a8734fa..0a516c48 100644 --- a/main.tf +++ b/main.tf @@ -127,6 +127,10 @@ locals { runners_capacity_per_instance = 1 runners_max_use_count = var.runner_worker_docker_autoscaler.max_use_count runners_max_instances = var.runner_worker.max_jobs + + runners_update_interval = var.runner_worker_docker_autoscaler.update_interval + runners_update_interval_when_expecting = var.runner_worker_docker_autoscaler.update_interval_when_expecting + runners_autoscaling = [for config in var.runner_worker_docker_autoscaler_autoscaling_options : { for key, value in config : # Convert key from snake_case to PascalCase which is the casing for this section. diff --git a/template/runner-docker-autoscaler-config.tftpl b/template/runner-docker-autoscaler-config.tftpl index 736fcc76..fa6f2cdb 100644 --- a/template/runner-docker-autoscaler-config.tftpl +++ b/template/runner-docker-autoscaler-config.tftpl @@ -3,6 +3,9 @@ plugin = "fleeting-plugin-aws" capacity_per_instance = ${runners_capacity_per_instance} + update_interval = ${runners_update_interval} + update_interval_when_expecting = ${runners_update_interval_when_expecting} + max_use_count = ${runners_max_use_count} max_instances = ${runners_max_instances} diff --git a/variables.tf b/variables.tf index 8f85bbdb..767c4554 100644 --- a/variables.tf +++ b/variables.tf @@ -607,12 +607,16 @@ variable "runner_worker_docker_autoscaler" { connector_config_user = User to connect to worker machine key_pair_name = The name of the key pair used by the Runner to connect to the docker-machine Runner Workers. This variable is only supported when `enables` is set to `true`. max_use_count = Max job number that can run on a worker + update_interval = The interval to check with the fleeting plugin for instance updates. + update_interval_when_expecting = The interval to check with the fleeting plugin for instance updates when expecting a state change. EOT type = object({ - fleeting_plugin_version = optional(string, "1.0.0") - connector_config_user = optional(string, "ec2-user") - key_pair_name = optional(string, "runner-worker-key") - max_use_count = optional(number, 100) + fleeting_plugin_version = optional(string, "1.0.0") + connector_config_user = optional(string, "ec2-user") + key_pair_name = optional(string, "runner-worker-key") + max_use_count = optional(number, 100) + update_interval = optional(string, "1m") + update_interval_when_expecting = optional(string, "2s") }) default = {} }