Skip to content

Commit 533bf4a

Browse files
Add precondition to check if no instances are available (#75)
Co-authored-by: Antonin <[email protected]>
1 parent 4cafbd5 commit 533bf4a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

node_group_advanced.tf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,13 @@ resource "aws_launch_template" "quortex_launch_tpl" {
165165
},
166166
var.tags
167167
)
168+
169+
lifecycle {
170+
precondition {
171+
condition = length(each.value.instance_types) > 0
172+
error_message = "node group '${each.key}' must have at least one instance type defined"
173+
}
174+
}
168175
}
169176

170177
# For each node group, create an autoscaling group based on the launch template

0 commit comments

Comments
 (0)