# Output for mapping of alert group names to folder IDs
output "folder_ids" {
  description = "Mapping of alert group names to their folder IDs in Grafana"
  value = merge(
    { for group_name, folder in grafana_folder.folders_ignore_and_protect : group_name => folder.id },
    { for group_name, folder in grafana_folder.folders_ignore_only : group_name => folder.id },
    { for group_name, folder in grafana_folder.folders_protect_only : group_name => folder.id },
    { for group_name, folder in grafana_folder.folders_standard : group_name => folder.id }
  )
}

# Output for mapping of alert group names to folder UIDs
output "folder_uids" {
  description = "Mapping of alert group names to their folder UIDs in Grafana"
  value = merge(
    { for group_name, folder in grafana_folder.folders_ignore_and_protect : group_name => folder.uid },
    { for group_name, folder in grafana_folder.folders_ignore_only : group_name => folder.uid },
    { for group_name, folder in grafana_folder.folders_protect_only : group_name => folder.uid },
    { for group_name, folder in grafana_folder.folders_standard : group_name => folder.uid }
  )
}
