terraform-provider-grafana icon indicating copy to clipboard operation
terraform-provider-grafana copied to clipboard

Adding Token as a parameter for Flux query language version for influxdb

Open arielpardomartin opened this issue 3 years ago • 1 comments

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.

arielpardomartin avatar Oct 19 '22 14:10 arielpardomartin

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 image

julienduchesne avatar Nov 11 '22 01:11 julienduchesne