You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
From Grafana documentation "If the dashboard in the json file contains an uid, Grafana will force insert/update on that uid". So, this mean that somehow Terraform is not sending the uid that I add on tpl (json).
From terraform-provider-grafana (here) I see that on function prepareDashboardModel both, id and uid, are being removed from json before sending this data to Grafana. This justifies why Grafana is creating new uid..
func prepareDashboardModel(configJSON string) map[string]interface{} {
configMap := map[string]interface{}{}
err := json.Unmarshal([]byte(configJSON), &configMap)
if err != nil {
// The validate function should've taken care of this.
panic(fmt.Errorf("Invalid JSON got into prepare func"))
}
delete(configMap, "id")
// Only exists in 5.0+
delete(configMap, "uid")
configMap["version"] = 0
return configMap
}
Is there any reason why uid is being removed?
uid is being used for Grafana to build the URL.. any other alternatives?
Steps to Reproduce
Send uid on json
Important Factoids
NA
References
NA
The text was updated successfully, but these errors were encountered:
Terraform Version
Affected Resource(s)
Terraform Configuration Files
my_dashboard.tpl
grafana.tf
Debug Output
NA
Panic Output
NA
Expected Behavior
Have the same uid (JOUdHGZZz) on Grafana, so URL should be:
https://abc.company.com/d/JOUdHGZZz/my-dashboard
Actual Behavior
Grafana shows different uid, the dashboard URL is:
https://abc.company.com/d/dlhHPsFGk/my-dashboard
From Grafana documentation "If the dashboard in the json file contains an uid, Grafana will force insert/update on that uid". So, this mean that somehow Terraform is not sending the uid that I add on tpl (json).
From terraform-provider-grafana (here) I see that on function prepareDashboardModel both, id and uid, are being removed from json before sending this data to Grafana. This justifies why Grafana is creating new uid..
Is there any reason why uid is being removed?
uid is being used for Grafana to build the URL.. any other alternatives?
Steps to Reproduce
Send uid on json
Important Factoids
NA
References
NA
The text was updated successfully, but these errors were encountered: