Skip to content

Commit e4737fd

Browse files
fix: use dynamic block to prevent resource be update all the time
1 parent 3f115cd commit e4737fd

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

modules/runners/main.tf

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,12 @@ resource "aws_launch_template" "runner" {
160160
}
161161
}
162162

163-
cpu_options {
164-
core_count = var.cpu_options != null ? var.cpu_options.core_count : null
165-
threads_per_core = var.cpu_options != null ? var.cpu_options.threads_per_core : null
163+
dynamic "cpu_options" {
164+
for_each = var.cpu_options != null ? [var.cpu_options] : []
165+
content {
166+
core_count = try(cpu_options.value.core_count, null)
167+
threads_per_core = try(cpu_options.value.threads_per_core, null)
168+
}
166169
}
167170

168171
monitoring {

0 commit comments

Comments
 (0)