Skip to content

Commit

Permalink
allow delete timeouts for asg
Browse files Browse the repository at this point in the history
  • Loading branch information
Filinto Duran committed Sep 2, 2021
1 parent c2bd137 commit 2253ba0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions local.tf
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ locals {
instance_refresh_instance_warmup = null # The number of seconds until a newly launched instance is configured and ready to use. Defaults to the ASG's health check grace period.
instance_refresh_triggers = [] # Set of additional property names that will trigger an Instance Refresh. A refresh will always be triggered by a change in any of launch_configuration, launch_template, or mixed_instances_policy.
capacity_rebalance = false # Enable capacity rebalance
asg_delete_timeout = null # Enable setting the timeouts for autoscaling groups delete operation
}

workers_group_defaults = merge(
Expand Down
7 changes: 7 additions & 0 deletions workers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,13 @@ resource "aws_autoscaling_group" "workers" {
"capacity_rebalance",
local.workers_group_defaults["capacity_rebalance"]
)
timeouts {
delete = lookup(
var.worker_groups[count.index],
"delete_timeout",
local.workers_group_defaults["asg_delete_timeout"]
)
}

dynamic "initial_lifecycle_hook" {
for_each = var.worker_create_initial_lifecycle_hooks ? lookup(var.worker_groups[count.index], "asg_initial_lifecycle_hooks", local.workers_group_defaults["asg_initial_lifecycle_hooks"]) : []
Expand Down
7 changes: 7 additions & 0 deletions workers_launch_template.tf
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,13 @@ resource "aws_autoscaling_group" "workers_launch_template" {
"capacity_rebalance",
local.workers_group_defaults["capacity_rebalance"]
)
timeouts {
delete = lookup(
var.worker_groups_launch_template[count.index],
"delete_timeout",
local.workers_group_defaults["asg_delete_timeout"]
)
}

dynamic "mixed_instances_policy" {
iterator = item
Expand Down

0 comments on commit 2253ba0

Please sign in to comment.