output "datasource_mapping" {
  description = "Mapping of data source names to their UIDs across all datasource categories"
  value = merge(
    {
      for ds in grafana_data_source.datasources_ignore_and_protect : ds.name => ds.uid if ds.id != null
    },
    {
      for ds in grafana_data_source.datasources_ignore_only : ds.name => ds.uid if ds.id != null
    },
    {
      for ds in grafana_data_source.datasources_protect_only : ds.name => ds.uid if ds.id != null
    },
    {
      for ds in grafana_data_source.datasources_standard : ds.name => ds.uid if ds.id != null
    }
  )
}
