28 lines
1.3 KiB
Terraform
28 lines
1.3 KiB
Terraform
|
|
variable "datasources" {
|
||
|
|
description = "List of Grafana data sources"
|
||
|
|
type = list(object({
|
||
|
|
# Main parameters
|
||
|
|
name = string # Data source name (displayed in Grafana)
|
||
|
|
uid = string # Unique source identifier
|
||
|
|
type = string # Data source type (e.g., prometheus, mysql, clickhouse)
|
||
|
|
url = optional(string, null) # Connection URL (for most sources)
|
||
|
|
username = optional(string, null)
|
||
|
|
access_mode = string # Access mode: proxy or direct
|
||
|
|
is_default = bool # Set as default source
|
||
|
|
|
||
|
|
# Authentication settings
|
||
|
|
basic_auth = optional(bool, false) # Use basic authentication
|
||
|
|
basic_auth_user = optional(string, null) # Username for basic authentication
|
||
|
|
basic_auth_password = optional(string, null) # Password for basic authentication
|
||
|
|
|
||
|
|
# Additional parameters
|
||
|
|
json_data = optional(map(any), {}) # Additional parameters in JSON format
|
||
|
|
secure_json_data = optional(map(string), {}) # Sensitive data in JSON format
|
||
|
|
|
||
|
|
# Terraform lifecycle management fields
|
||
|
|
keep_manual_changes = optional(bool, false) # Ignore manual changes in Grafana
|
||
|
|
prevent_destroy_on_recreate = optional(bool, false) # Prevent resource deletion on update
|
||
|
|
}))
|
||
|
|
}
|
||
|
|
|