Skip to content

Commit 11f7777

Browse files
internetstaffnpalm
authored andcommitted
fix Use dynamic block to thwart endless churn on spot_options block when using on-demand-price (#475)
1 parent c1f2893 commit 11f7777

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Diff for: main.tf

+5-2
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,11 @@ resource "aws_launch_template" "gitlab_runner_instance" {
226226
for_each = var.runner_instance_spot_price == null || var.runner_instance_spot_price == "" ? [] : ["spot"]
227227
content {
228228
market_type = instance_market_options.value
229-
spot_options {
230-
max_price = var.runner_instance_spot_price == "on-demand-price" ? "" : var.runner_instance_spot_price
229+
dynamic "spot_options" {
230+
for_each = var.runner_instance_spot_price == "on-demand-price" ? [] : [0]
231+
content {
232+
max_price = var.runner_instance_spot_price
233+
}
231234
}
232235
}
233236
}

0 commit comments

Comments
 (0)