List all resource groups in a azure subscription?

It is returning null. Any suggestions. I need all resource groups in a subscription

data "azurerm_resources" "listresourcegroups" {
type="Microsoft.Resources/resourceGroups"
}

output "name" {
  value= data.azurerm_resources.listresourcegroups
}

Is it possible to list all resource groups in azure using terraform