In azure, I need to get Vnet details for a tenant and find all subnet details.
In terraform website we can iterate only one vnet with name and resource group.
Did this help you? Use data sources to get exist resources details.
data "azurerm_subnet" "test" {
name = "backend"
virtual_network_name = "production"
resource_group_name = "networking"
}
output "subnet_id" {
value = "${data.azurerm_subnet.test.id}"
}
Reference: https://www.terraform.io/docs/providers/azurerm/d/subnet.html