Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add delete timeout to aws_autoscaling_group #1566

Closed
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion workers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@ resource "aws_autoscaling_group" "workers" {
"capacity_rebalance",
local.workers_group_defaults["capacity_rebalance"]
)

timeouts {
delete = lookup(local.workers_group_defaults["timeouts"], "delete", null)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be customized via workers_group_defaults["timeouts"] but also via timeouts setting per particulal worker definition as rest of parameters which are defined here https://github.com/terraform-aws-modules/terraform-aws-eks/blob/master/locals.tf

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added an extra lookup against the per particular worker definition

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will work, but in general this is in other way as other variables. Please review and use same pattern which we arleady using

Copy link
Author

@filintod filintod Nov 10, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@daroga0002 could you explain/point out to me as I did not find it.

In node_groups, timeouts is used like:

  timeouts {
    create = lookup(each.value["timeouts"], "create", null)
    update = lookup(each.value["timeouts"], "update", null)
    delete = lookup(each.value["timeouts"], "delete", null)
  }

where each is from https://github.com/terraform-aws-modules/terraform-aws-eks/blob/master/modules/node_groups/main.tf#L2 where they have timeouts as timeouts = var.workers_group_defaults["timeouts"]

I guess I could add timeouts in locals.tf. But not sure if that is overkill as that was not added before, and from what I can see it would just change local.workers_group_defaults["timeouts"] for local.timeouts. Let me know or please point me to an example as I did not see anything similar from my point of view.

}
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"]) : []
content {
Expand Down
3 changes: 3 additions & 0 deletions workers_launch_template.tf
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ resource "aws_autoscaling_group" "workers_launch_template" {
"capacity_rebalance",
local.workers_group_defaults["capacity_rebalance"]
)
timeouts {
delete = lookup(local.workers_group_defaults["timeouts"], "delete", null)
}

dynamic "mixed_instances_policy" {
iterator = item
Expand Down