GrafanaJsonDatasource
GrafanaJsonDatasource copied to clipboard
Terraform resource definition
We try to configure Grafana using Terraform so it was a challenge to find the correct variables (still have not found some, for example withCredentials).
But I think it might be a good starting point and maybe something to add to the documentation. As I have more than one JSON source, I've put it into a for each, so you can call the module with an list object to have multiple of them configured.
resource "grafana_data_source" "json-datasource" {
for_each = { for each in var.json-datasources : each.name => each }
type = "simpod-json-datasource"
uid = each.value.uid
name = each.value.name
url = each.value.url
basic_auth_enabled = true
basic_auth_username = each.value.username
json_data_encoded = jsonencode (
{
tlsSkipVerify = true
withCredentials = true #not working
}
)
secure_json_data_encoded = jsonencode (
{
basicAuthPassword = each.value.secret
}
)
}
Thanks for your work.
I have no personal experience with TF but PR is welcome. Can be added to docs/ with some disclaimer.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
This issue has not seen any activity since it was marked stale. Closing.