diff --git a/examples/instance_refresh/main.tf b/examples/instance_refresh/main.tf index 7c60621163..1b87d8e521 100644 --- a/examples/instance_refresh/main.tf +++ b/examples/instance_refresh/main.tf @@ -217,10 +217,9 @@ resource "helm_release" "aws_node_termination_handler" { # ensures that node termination does not require the lifecycle action to be completed, # and thus allows the ASG to be destroyed cleanly. resource "aws_autoscaling_lifecycle_hook" "aws_node_termination_handler" { - for_each = toset(module.eks.workers_asg_names) - + count = length(module.eks.workers_asg_names) name = "aws-node-termination-handler" - autoscaling_group_name = each.value + autoscaling_group_name = module.eks.workers_asg_names[count.index] lifecycle_transition = "autoscaling:EC2_INSTANCE_TERMINATING" heartbeat_timeout = 300 default_result = "CONTINUE"