Hi, I am trying to create a dynamic block for a google_compute_instance nested block, but keep getting the error Blocks of type "metadata" are not expected here
The code for the blocks(without using dynamic) should look like
metadata = {
ssh-keys = "user:rsakeyefwefewfwefefwetc"
}
metadata = {
ssh-keys = "user2:rsakey2efwefewfwefefwetc"
}
and here is my try at using the dynamic feature of TF
dynamic "metadata" {
for_each = var.ssh_keys_map
content {
ssh-keys = "${metadata.value.user}:${metadata.value.key}"
}
}
Any idea what I am doing wrong?