Add dashboard UID auto-generation and Gitea CI workflow
This commit is contained in:
51
environments/modules/grafana_dashboard_folder_xt5/main.tf
Normal file
51
environments/modules/grafana_dashboard_folder_xt5/main.tf
Normal file
@ -0,0 +1,51 @@
|
||||
# Folders with both manual changes allowed and destroy protection
|
||||
# Note: Currently, Terraform Grafana provider doesn't support nested folders directly.
|
||||
# Folders will be created as flat structure. Nested structure can be configured
|
||||
# manually in Grafana UI or via API after creation.
|
||||
resource "grafana_folder" "folders_ignore_and_protect" {
|
||||
for_each = local.folders_ignore_and_protect
|
||||
|
||||
title = each.value.folder_title
|
||||
uid = each.value.group.folder_uid
|
||||
org_id = var.org_id
|
||||
|
||||
lifecycle {
|
||||
ignore_changes = [title]
|
||||
prevent_destroy = true
|
||||
}
|
||||
}
|
||||
|
||||
# Folders with only manual changes allowed
|
||||
resource "grafana_folder" "folders_ignore_only" {
|
||||
for_each = local.folders_ignore_only
|
||||
|
||||
title = each.value.folder_title
|
||||
uid = each.value.group.folder_uid
|
||||
org_id = var.org_id
|
||||
|
||||
lifecycle {
|
||||
ignore_changes = [title]
|
||||
}
|
||||
}
|
||||
|
||||
# Folders with only destroy protection
|
||||
resource "grafana_folder" "folders_protect_only" {
|
||||
for_each = local.folders_protect_only
|
||||
|
||||
title = each.value.folder_title
|
||||
uid = each.value.group.folder_uid
|
||||
org_id = var.org_id
|
||||
|
||||
lifecycle {
|
||||
prevent_destroy = true
|
||||
}
|
||||
}
|
||||
|
||||
# Standard folders without any special lifecycle management
|
||||
resource "grafana_folder" "folders_standard" {
|
||||
for_each = local.folders_standard
|
||||
|
||||
title = each.value.folder_title
|
||||
uid = each.value.group.folder_uid
|
||||
org_id = var.org_id
|
||||
}
|
||||
Reference in New Issue
Block a user