resource "grafana_mute_timing" "groupname_mute_timings" {
for_each = toset([for key, value in local.alerts : value.groupname if value.mute == true])
name = each.value
disable_provenance = true
intervals {}
}
resource "grafana_rule_group" "this" {
for_each = { for key, value in local.alerts : key => value }
name = each.value.groupname
folder_uid = grafana_folder.this[each.value.folder].uid
interval_seconds = 60
disable_provenance = try(each.value.disable_provenance, true)
dynamic "rule" {
for_each = each.value.alert_data
content {
dynamic "notification_settings" {
for_each = [for cur in rule.value.notifiers : cur if length(rule.value.notifiers) == 1]
content {
contact_point = notification_settings.value.slug
group_by = try(rule.value.signal_grouping.label_names, [])
mute_timings = each.value.mute ? [each.value.groupname] : []
}
}
}
Expected Behavior
Deleting mute timings that are attached to a grafana_rule_group should first be removed from the rule_group and then successfully be deleted.
Actual Behavior
Trying to delete any mute_timing that is attached to a grafana_rule_group returns the error:
Error: error reading mute timing with ID0:XXXXX: [DELETE /v1/provisioning/mute-timings/{name}][409] deleteMuteTimingConflict {}
Deleting mute timings that aren't attached to a grafana_rule_group is fine. Havent tested with a notification policy.
Steps to Reproduce
Create a mute timing
Attach it to any alert rule
Attempt to delete the mute timing
Fail
Important Factoids
I believed this was taken care of in this other issue, but that was specifically for mute timing tied to notification policies. Seems like either a revert (this was working a week ago), or it never worked for notification_settings within the grafana_rule_group
Terraform Version
v1.3.6
Terraform Grafana Provider Version
v3.2.0
Grafana Version
grafana cloud
Affected Resource(s)
Terraform Configuration Files
Expected Behavior
Deleting mute timings that are attached to a grafana_rule_group should first be removed from the rule_group and then successfully be deleted.
Actual Behavior
Trying to delete any mute_timing that is attached to a grafana_rule_group returns the error:
Error: error reading mute timing with ID
0:XXXXX: [DELETE /v1/provisioning/mute-timings/{name}][409] deleteMuteTimingConflict {}
Deleting mute timings that aren't attached to a grafana_rule_group is fine. Havent tested with a notification policy.
Steps to Reproduce
Important Factoids
I believed this was taken care of in this other issue, but that was specifically for mute timing tied to notification policies. Seems like either a revert (this was working a week ago), or it never worked for notification_settings within the
grafana_rule_group
References
No response