Add dashboard UID auto-generation and Gitea CI workflow
This commit is contained in:
25
environments/modules/grafana_datasource/locals.tf
Normal file
25
environments/modules/grafana_datasource/locals.tf
Normal file
@ -0,0 +1,25 @@
|
||||
locals {
|
||||
# Data sources with both manual changes allowed and destroy protection
|
||||
datasources_ignore_and_protect = {
|
||||
for ds in var.datasources : ds.name => ds
|
||||
if lookup(ds, "keep_manual_changes", false) && lookup(ds, "prevent_destroy_on_recreate", false)
|
||||
}
|
||||
|
||||
# Data sources with only manual changes allowed
|
||||
datasources_ignore_only = {
|
||||
for ds in var.datasources : ds.name => ds
|
||||
if lookup(ds, "keep_manual_changes", false) && !lookup(ds, "prevent_destroy_on_recreate", false)
|
||||
}
|
||||
|
||||
# Data sources with only destroy protection enabled
|
||||
datasources_protect_only = {
|
||||
for ds in var.datasources : ds.name => ds
|
||||
if !lookup(ds, "keep_manual_changes", false) && lookup(ds, "prevent_destroy_on_recreate", false)
|
||||
}
|
||||
|
||||
# Standard data sources without any special lifecycle management
|
||||
datasources_standard = {
|
||||
for ds in var.datasources : ds.name => ds
|
||||
if !lookup(ds, "keep_manual_changes", false) && !lookup(ds, "prevent_destroy_on_recreate", false)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user