consider the following HCL Map:
locals {
disks = {
sda = {
size = 1024
thin = true
}
sdb = {
size = 2048
thin = false
}
}
}
and the following source "vsphere-iso" "linux-rhel" dynamic storage block:
dynamic "storage" {
for_each = local.disks
content {
disk_size = storage.value.size
disk_thin_provisioned = storage.value.thin
disk_controller_index = ???
}
}
What value can I substitute ??? for that will increment with each iteration?
I know count.index works with a count=XX loop, but would like to not have to add the index value to the the map, since it's just calculated anyway.
One way would be to add
indextolocal.disks:Alternatively iterate over
keys:but the
storage.keywill not necessarily represent apparent order as inlocal.disks, because maps do not have order.