hi,
I’m trying to do the following :
data "subnet" "foo" {
name = "sub"
}
locals {
network = ["foo"]
}
dynamic "nic_list" {
for_each = local.network
content {
bar = data.subnet.${nic_list.value}.metadata.uuid
}
}
but i’m getting Error: Invalid attribute name
, an attribute name is required after a dot
Thus I tried to surround bar value with quote which seems to work in a sense.
Bar variable effectively get assigned the string litteral data.subnet.foo.metadata.uuid
whereas I was expecting that it would be expanded to the real datasource attribute value.
Is this how terraform do interpolation ?
Is there a way to assign dynamiccaly from datasource value ?