Terraform Variable file
---- Variable File ----
variable "vm_tags" {
type = map(string)
default = {
"owner" = "abc",
"Env" = "Prod"
}
}
-----------------------------------------------------------------------------
---- main.tf ----
dynamic "tags" {
for_each = var.vm_tags
content{
tags.key = tags.value
}
}
---------------------------------------------------------------
Below is the error i am getting while terraform plan
Error: Argument or block definition required
on main.tf line 45, in resource "azurerm_windows_virtual_machine" "myvm": tags.key = tags.value
An argument or block definition is required here. To set an argument, use the
equals sign "=" to introduce the argument value.
Tags count will be dynamic