Created
September 3, 2021 20:08
-
-
Save gkspranger/976ab207f6d20ad772638cac9174e684 to your computer and use it in GitHub Desktop.
using count on a list of maps
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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