terraform-provider-grafana
terraform-provider-grafana copied to clipboard
Adding Token as a parameter for Flux query language version for influxdb
Actually, the only way to integrate with influxdb is with username and password using influxQL query language. To allow Flux version for query language is necessary add Token as a parameter.
You can specify your datasource this way:
resource "grafana_data_source" "influxdb" {
type = "influxdb"
name = "my-ds"
url = "http://influxdb.example.net:8086/"
json_data_encoded = jsonencode({
defaultBucket = "my-bucket"
httpMode = "POST"
organization = "my-org"
timeout = 5
tlsAuth = false
tlsAuthWithCACert = false
version = "Flux"
})
secure_json_data_encoded = jsonencode({
token = "test-token"
})
}
The way to figure out the fields is by checking out the influxDB plugin docs: https://grafana.com/docs/grafana/latest/datasources/influxdb/ or more easily by saving a datasource in Grafana and inspecting it
