From ccacc1779284e36ebdbe7c366eaba17adf4280e6 Mon Sep 17 00:00:00 2001 From: svaranasi-traderev <45045920+svaranasi-traderev@users.noreply.github.com> Date: Tue, 22 Dec 2020 05:55:43 -0500 Subject: [PATCH] feat: Add customizable Auto Scaling Group health check type (#1118) --- local.tf | 1 + workers.tf | 5 +++++ workers_launch_template.tf | 5 +++++ 3 files changed, 11 insertions(+) diff --git a/local.tf b/local.tf index bb23a63..210f884 100644 --- a/local.tf +++ b/local.tf @@ -37,6 +37,7 @@ locals { asg_initial_lifecycle_hooks = [] # Initital lifecycle hook for the autoscaling group. asg_recreate_on_change = false # Recreate the autoscaling group when the Launch Template or Launch Configuration change. default_cooldown = null # The amount of time, in seconds, after a scaling activity completes before another scaling activity can start. + health_check_type = null # Controls how health checking is done. Valid values are "EC2" or "ELB". health_check_grace_period = null # Time in seconds after instance comes into service before checking health. instance_type = "m4.large" # Size of the workers instances. spot_price = "" # Cost of spot instance. diff --git a/workers.tf b/workers.tf index e99d3ae..8143e6a 100644 --- a/workers.tf +++ b/workers.tf @@ -88,6 +88,11 @@ resource "aws_autoscaling_group" "workers" { "default_cooldown", local.workers_group_defaults["default_cooldown"] ) + health_check_type = lookup( + var.worker_groups[count.index], + "health_check_type", + local.workers_group_defaults["health_check_type"] + ) health_check_grace_period = lookup( var.worker_groups[count.index], "health_check_grace_period", diff --git a/workers_launch_template.tf b/workers_launch_template.tf index 165d9a9..f0e0f1a 100644 --- a/workers_launch_template.tf +++ b/workers_launch_template.tf @@ -87,6 +87,11 @@ resource "aws_autoscaling_group" "workers_launch_template" { "default_cooldown", local.workers_group_defaults["default_cooldown"] ) + health_check_type = lookup( + var.worker_groups_launch_template[count.index], + "health_check_type", + local.workers_group_defaults["health_check_type"] + ) health_check_grace_period = lookup( var.worker_groups_launch_template[count.index], "health_check_grace_period",