variable "details" {
description = "details"
default = [
{
details_name = "name"
details_filesystem_name = ["test1", "test2"]
details_filesystem_path_name = {
"test1" = ["path1", "path2"]
"test2" = ["path3", "path4"]
}
}
}
]
I should be able to create 8 resources.
I am able to create example1 resource
resource "example1" "default1" {
for_each = { for idx, details in var.details : idx => details } : {}
}
When I ran the plan on the example2 resource I had an issue
account.details_filesystem_name is a tuple with 2 elements
│
│ Cannot include the given value in a string template: string required.
resource "example2" "default2" {
for_each = { for idx, account in var.details : idx => account.details_filesystem_name }
name = each.value
the same thing goes for details_filesystem_path_name. how to overcome the issue