I have a module which is fetching managed disks from a resource group, then i am calling this module from another module where the names of all the managed disk will be displayed.
When i run plan command , i am getting an error "name must be a single value, not a list". How do i display values from a list ??
Module 1 - Fetching Values
data "azurerm_managed_disk" "disk" {
resource_group_name = "mfa-rg"
name = ["*"]
}
output "disks" {
value = ["${data.azurerm_managed_disk.disk.name}"]
}
Module 2 - calling module 1 to display values
module "rgmod"{
source = "./RG"
}
output "rgdetails"{
value = "${module.rgmod.disks}"
}
rgdetails
output in square brackets like you have for thedisks
output? – ydaetskcoR