terraform-provider-grafana: [Bug]: Error: id ":" does not match expected format. Should be in the format: folderUID:title
Terraform Version
v1.8.2
Terraform Grafana Provider Version
2.15~2.18
Grafana Version
10.4.1
Affected Resource(s)
grafana_rule_group
Terraform Configuration Files
we have created a meta module for alerting which looks like this:
`resource “grafana_rule_group” “rule_group” { name = var.name folder_uid = var.folder_uid
interval_seconds = coalesce(var.evaluation_interval_seconds, local.evaluation_interval_seconds_default)
rule { name = var.name for = coalesce(var.alert_rule_for_duration, local.alert_rule_for_duration_default) condition = var.condition_ref_id == null ? var.alert_rule_data[length(var.alert_rule_data) - 1].ref_id : var.condition_ref_id
no_data_state = coalesce(var.alert_rule_no_data_behavior, local.alert_rule_no_data_behavior_default)
exec_err_state = coalesce(var.alert_rule_exec_error_behavior, local.alert_rule_exec_error_behavior_default)
labels = merge(var.alert_rule_labels, local.labels_default)
annotations = var.alert_rule_annotations
dynamic "data" {
for_each = var.alert_rule_data
content {
ref_id = data.value.ref_id
datasource_uid = data.value.datasource_uid
query_type = data.value.query_type
model = data.value.model
relative_time_range {
from = data.value.datasource_uid == "-100" ? 0 : data.value.relative_time_range.from
to = data.value.relative_time_range.to
}
}
}
} }`
Expected Behavior
After upgrading terraform provider, we should be able to apply it without changing the whole alerting even when no changes
Actual Behavior
After bump to provider > 2.15, we have this warning during apply:
Warning: rule group with ID "0:<folder uid>;<alert name>" is in Terraform state, but no longer exists in Grafana
which gives us this error:
Error: id "<folder uid>:<alert name>" does not match expected format. Should be in the format: folderUID:title
On our side, no changes happened on the alerting, but from the error, we can see the warning do a separation via a ; between folder uid and alert name when the error do the separation via a :
Steps to Reproduce
Apply the terraform using 2.14.3 Update to > 2.14.3
Important Factoids
No response
References
No response
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 18 (8 by maintainers)
Facing pretty much the same issue.
Terraform Version
v1.4.6
Terraform Grafana Provider Version
3.0.0
Using AWS Managed Grafana
Affected Resource(s)
grafana_rule_group
Terraform Configuration Files
I have created a terraform module for alerting to create rule groups with a folder
resource "grafana_folder" "rule_folder" { title = var.grafana_rule_folder_title }and a rule groupThis was working weeks ago and I was using
Terraform Grafana Provider version = ">= 1.28.2"at the time, then I wanted to delete one rule from the rule group so I just omitted the rule from the code that’s when I faced this warning first:Warning: contact point with ID "xxxxxxxx" is in Terraform state, but no longer exists in Grafanaand then this error:
Error: id "xxxxx;rule_group_name" does not match expected format. Should be in the format: folderUID:titlenot sure why it is a ; instead of : in there (odam06 mentioned he had the same, also in my case I don’t have nested folders)I changed the terraform grafana version to
version = ">= 3.0.0but still faced the same issue. I also tried to go back to the old code when this worked for me (the exact same without changing anything) but still had the same issueWe are observing this issue now. Details are:
Terraform Version v1.8.3
Terraform Grafana Provider Version v3.0.0
Grafana Version v11.1.0-70724
Affected Resource(s) grafana_rule_group
Terraform Configuration Files
It’s already failing without changing the version (I changed the version in an attempt to fix the issue). Also this failing at the plan level so before a tf apply.