Skip to content

Commit 2253ba0

Browse files
author
Filinto Duran
committed
allow delete timeouts for asg
1 parent c2bd137 commit 2253ba0

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

local.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ locals {
129129
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.
130130
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.
131131
capacity_rebalance = false # Enable capacity rebalance
132+
asg_delete_timeout = null # Enable setting the timeouts for autoscaling groups delete operation
132133
}
133134

134135
workers_group_defaults = merge(

workers.tf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,13 @@ resource "aws_autoscaling_group" "workers" {
102102
"capacity_rebalance",
103103
local.workers_group_defaults["capacity_rebalance"]
104104
)
105+
timeouts {
106+
delete = lookup(
107+
var.worker_groups[count.index],
108+
"delete_timeout",
109+
local.workers_group_defaults["asg_delete_timeout"]
110+
)
111+
}
105112

106113
dynamic "initial_lifecycle_hook" {
107114
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"]) : []

workers_launch_template.tf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,13 @@ resource "aws_autoscaling_group" "workers_launch_template" {
101101
"capacity_rebalance",
102102
local.workers_group_defaults["capacity_rebalance"]
103103
)
104+
timeouts {
105+
delete = lookup(
106+
var.worker_groups_launch_template[count.index],
107+
"delete_timeout",
108+
local.workers_group_defaults["asg_delete_timeout"]
109+
)
110+
}
104111

105112
dynamic "mixed_instances_policy" {
106113
iterator = item

0 commit comments

Comments
 (0)