Skip to content

Commit

Permalink
remove list functions in favor of sqaure brackets
Browse files Browse the repository at this point in the history
Signed-off-by: Samuel Bégin <[email protected]>
  • Loading branch information
sbeginCoveo committed May 4, 2021
1 parent 5acb0b7 commit 1bafbdb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions workers_launch_template.tf
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ resource "aws_autoscaling_group" "workers_launch_template" {

dynamic "mixed_instances_policy" {
iterator = item
for_each = (lookup(each.value, "override_instance_types", null) != null) || (each.value.on_demand_allocation_strategy != null) ? list(each.value) : []
for_each = (lookup(each.value, "override_instance_types", null) != null) || (each.value.on_demand_allocation_strategy != null) ? [each.value] : []

content {
instances_distribution {
Expand Down Expand Up @@ -65,7 +65,7 @@ resource "aws_autoscaling_group" "workers_launch_template" {

dynamic "launch_template" {
iterator = item
for_each = (lookup(each.value, "override_instance_types", null) != null) || (each.value.on_demand_allocation_strategy != null) ? [] : list(each.value)
for_each = (lookup(each.value, "override_instance_types", null) != null) || (each.value.on_demand_allocation_strategy != null) ? [] : [each.value]

content {
id = aws_launch_template.workers_launch_template[each.key].id
Expand Down Expand Up @@ -223,7 +223,7 @@ resource "aws_launch_template" "workers_launch_template" {
}

dynamic "instance_market_options" {
for_each = lookup(each.value, "market_type", null) == null ? [] : list(lookup(each.value, "market_type", null))
for_each = lookup(each.value, "market_type", null) == null ? [] : [lookup(each.value, "market_type", null)]
content {
market_type = instance_market_options.value
}
Expand Down

0 comments on commit 1bafbdb

Please sign in to comment.