Skip to content

Commit

Permalink
feat: Add customizable Auto Scaling Group health check type (#1118)
Browse files Browse the repository at this point in the history
  • Loading branch information
svaranasi-corporate authored Dec 22, 2020
1 parent b0f51fd commit ccacc17
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions local.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
5 changes: 5 additions & 0 deletions workers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
5 changes: 5 additions & 0 deletions workers_launch_template.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit ccacc17

Please sign in to comment.