I am trying to use a list in dynamic block to create multiple resources for each elements:
variables file like:
variable "example" {
description = "(optional) describe your variable"
type = map(any)
default = {
"key" = {
"value" = [1, 2]
}
}
Now in dynamic block trying to use the value to create multiple resources with each elements from list:
dynamic "block" {
for_each = [for v in var.example : {
value = v.value
}]
content {
value = block.value
}
}
But its not taking each values. Instead taking the list seems.
How to achieve this?
TIA