Skip to content

Tidy up some formatting where lookup and map functions are used #128

@max-rocket-internet

Description

@max-rocket-internet

strygin made a PR that was never completed but had some very nice formatting changes in it.

It would be great to get these cosmetic changes merged.

Example 1

Replace this:

resource "null_resource" "tags_as_list_of_maps" {
  count = "${length(keys(var.tags))}"

  triggers = "${map(
    "key", "${element(keys(var.tags), count.index)}",
    "value", "${element(values(var.tags), count.index)}",
    "propagate_at_launch", "true"
  )}"
}

With:

resource "null_resource" "tags_as_list_of_maps" {
  count = "${length(keys(var.tags))}"

  triggers = {
    key                 = "${element(keys(var.tags), count.index)}"
    value               = "${element(values(var.tags), count.index)}"
    propagate_at_launch = "true"
  }
}

Example 2

Replace this:

"${lookup(var.worker_groups[count.index], "asg_max_size",lookup(var.workers_group_defaults, "asg_max_size"))}"

With:

"${lookup(var.worker_groups[count.index], "asg_max_size", var.workers_group_defaults["asg_max_size"])}"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions