added grafana module
This commit is contained in:
parent
878ecba717
commit
7c9e84971e
38 changed files with 583 additions and 0 deletions
11
grafana/datasource/datasource.tf
Normal file
11
grafana/datasource/datasource.tf
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
resource "grafana_data_source" "this" {
|
||||
type = "prometheus"
|
||||
name = var.datasource_name
|
||||
url = var.datasource_url
|
||||
basic_auth_enabled = true
|
||||
basic_auth_username = var.datasource_username
|
||||
|
||||
secure_json_data_encoded = jsonencode({
|
||||
basicAuthPassword = var.datasource_password
|
||||
})
|
||||
}
|
||||
3
grafana/datasource/output.tf
Normal file
3
grafana/datasource/output.tf
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
output "datasource_uid" {
|
||||
value = grafana_data_source.this.uid
|
||||
}
|
||||
8
grafana/datasource/providers.tf
Normal file
8
grafana/datasource/providers.tf
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
terraform {
|
||||
required_providers {
|
||||
grafana = {
|
||||
source = "grafana/grafana"
|
||||
version = "= 3.25.4"
|
||||
}
|
||||
}
|
||||
}
|
||||
18
grafana/datasource/variables.tf
Normal file
18
grafana/datasource/variables.tf
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
# Grafana contact point
|
||||
variable "datasource_url" {
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "datasource_name" {
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "datasource_username" {
|
||||
type = string
|
||||
sensitive = true
|
||||
}
|
||||
|
||||
variable "datasource_password" {
|
||||
type = string
|
||||
sensitive = true
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue