Skip to content

Commit

Permalink
fix: use dynamic block to ignore null market opts (philips-labs#1202)
Browse files Browse the repository at this point in the history
Signed-off-by: Trevor Wood <Trevor.G.Wood@gmail.com>
  • Loading branch information
taharah authored Sep 30, 2021
1 parent 439fb1b commit 06a5598
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions modules/runners/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,12 @@ resource "aws_launch_template" "runner" {

instance_initiated_shutdown_behavior = "terminate"

instance_market_options {
market_type = var.market_options
dynamic "instance_market_options" {
for_each = var.market_options != null ? [var.market_options] : []

content {
market_type = instance_market_options.value
}
}

image_id = data.aws_ami.runner.id
Expand Down

0 comments on commit 06a5598

Please sign in to comment.