Skip to content

Instantly share code, notes, and snippets.

@gkspranger
Created September 3, 2021 20:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gkspranger/976ab207f6d20ad772638cac9174e684 to your computer and use it in GitHub Desktop.
Save gkspranger/976ab207f6d20ad772638cac9174e684 to your computer and use it in GitHub Desktop.
using count on a list of maps
locals {
minions = [
{ "name" = "greg",
"type" = "m5.large" },
{ "name" = "ragha",
"type" = "t3.micro"
}
]
}
resource "null_resource" "minions" {
count = length(local.minions)
triggers = {
name = local.minions[count.index].name
type = local.minions[count.index].type
}
}
output "minions" {
value = null_resource.minions
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment