35 lines
1.2 KiB
HCL
35 lines
1.2 KiB
HCL
# Define datasources (non-sensitive metadata only)
|
|
variable "datasources" {
|
|
description = <<EOT
|
|
Map of datasources to create. Keys are datasource names.
|
|
Each datasource specifies type (prometheus/loki), keys to lookup URL/user/password,
|
|
and optional is_default (true/false).
|
|
EOT
|
|
type = map(object({
|
|
type = string # e.g., prometheus, loki
|
|
url_key = string # key for URL lookup in datasource_urls map
|
|
user_key = string # key for username lookup in datasource_users map
|
|
pass_key = string # key for password lookup in datasource_passwords map
|
|
is_default = optional(bool) # true if this datasource should be Grafana default
|
|
json_data = optional(map(any))
|
|
}))
|
|
}
|
|
|
|
# Sensitive maps for URLs, usernames, passwords
|
|
variable "datasource_urls" {
|
|
description = "Map of datasource URLs, keyed by url_key"
|
|
type = map(string)
|
|
sensitive = true
|
|
}
|
|
|
|
variable "datasource_users" {
|
|
description = "Map of datasource usernames, keyed by user_key"
|
|
type = map(string)
|
|
sensitive = true
|
|
}
|
|
|
|
variable "datasource_passwords" {
|
|
description = "Map of datasource passwords, keyed by pass_key"
|
|
type = map(string)
|
|
sensitive = true
|
|
}
|