provider "azurerm" {
features{}
}
locals {
resource_groupname = csvdecode(file("./ResourceTypes.csv"))
json_data = jsondecode(file("${path.module}/Monitor.json"))
}
resource "azurerm_resource_group" "Main" {
count = length(local.resource_groupname)
name = local.resource_groupname[count.index].resourcetype
location = "North europe"
}
resource "azurerm_resource_group" "json" {
# (other settings)
name = local.json_data.name
location = "North europe"
}
output "local_json_data" {
value = local.json_data.name
}
when I use the name property from the JSON object as shown in the above code, its returns an error.
╷
│ Error: "name" may only contain alphanumeric characters, dash, underscores, parentheses and periods
│
│ with azurerm_resource_group.json,
│ on Monitor.tf line 15, in resource "azurerm_resource_group" "json":
│ 15: resource "azurerm_resource_group" "json" {