terraform-provider-grafana
terraform-provider-grafana copied to clipboard
Unable to create mute timing for All hours, All Days, All Years, etc...
Terraform Version
- Terraform: Terraform v1.2.0
- Terraform Grafana Provider: 1.28.1
- Grafana: v9.1.0
Affected Resource(s)
- grafana_mute_timing
Configuration
resource "grafana_mute_timing" "mute_all" { provider = grafana.MyProject name = "All" intervals {} }
Panic Output
Expected Behavior
What should have happened? It should have created a mute timing for All Hours, All Days, All Years (24/7 mute timing)
Actual Behavior
What actually happened? Plugin threw and error
Steps to Reproduce
Please list the steps required to reproduce the issue, for example: terraform apply Answer yes to apply
Important Factoids
Running Grafana on AWS ECS
References
Are there any other GitHub issues (open or closed) or Pull Requests that should be linked here? For example: Nope, not that I could find
When leaving the "intervals" out completely, it creates a mute_timing without any intervals which is not desired.
See below:

When creating this manually, it works and is what I want

Work around is to define at least something in the intervals. I defined every day of the week, and it worked.
resource "grafana_mute_timing" "mute_all" {
provider = grafana.Mopane
name = "All"
intervals {
weekdays = ["saturday", "sunday", "monday", "tuesday", "wednesday", "thursday", "friday"]
}
}
Hi! :wave: Thanks for reporting this!
This certainly seems to be a bug. It's a bit surprising as to what representations the API uses to signify "all" vs "none" of the given period type. For instance, the UI actually sends an empty slice for times if not specified, but the empty slice appears to have a different meaning for the other time ranges. The panic seems to be a result of this.
I think we'll need to add a special case for this one. Let me put a PR together.
Thanks for taking a look at this.
I think what you say makes a lot of sense and in the system, even the interpretation is different from what is shown in the UI. For example. I have that "All" mute timing specified above, and in my SIT and UAT testing environments, I have all the notification policies set to use that mute timing. The expected result would be that I should never get any notifications sent from those environments whilst I can still observe them in the UI. But, notifications are still being sent regardless of this setting.
So, the UI is saying that mute timing applies to all times, but, in fact, is it maybe none of the time?