Open mleonhard opened 4 years ago
I need this because Grafana reloads dashboard files only when their timestamp has increased. It stores the timestamp in its database. Grafana's dashboards.fileReader.saveDashboard()
I found two workarounds:
locals {
dashboard_json = file("${path.module}/containers.json")
}
resource "docker_container" "grafana" {
upload {
file = "/etc/grafana/provisioning/dashboards/containers.json"
content = file("${path.module}/containers.json")
file = "/etc/grafana/provisioning/dashboards/dashboard.${md5(local.dashboard_json)}.json"
content = local.dashboard_json
}
...
}
Terraform Version
Affected Resource(s)
Terraform Configuration Files
Expected Behavior
I need Terraform to update the timestamp of the uploaded file when it changes the file's contents.
Actual Behavior
Terraform currently uploads the file and sets its timestamp to 0. It also sets its owner to
root
. A non-root container cannot update the file timestamp.