grafana / terraform-provider-grafana

Terraform Grafana provider
https://www.terraform.io/docs/providers/grafana/
Mozilla Public License 2.0
425 stars 225 forks source link

[Bug]: Upgrading from `2.8.1` to `3.7.0` Yields `Error invalid ID` around Folders #1793

Closed bixu closed 3 weeks ago

bixu commented 3 weeks ago

Terraform Version

1.7.1

Terraform Grafana Provider Version

3.7.0

Grafana Version

10.2.3

Affected Resource(s)

Terraform Configuration Files

Trimmed for brevity.

terraform {
  required_providers {
    grafana = {
      source = "grafana/grafana"
    }
  }
}

data "grafana_folder" "folder" {
  title = "folder title"
}

resource "grafana_rule_group" "group" {
  org_id           = 1
  name             = "foo"
  folder_uid       = data.grafana_folder.folder.uid
}

Expected Behavior

plan and apply should have completed.

Actual Behavior

plan state failed with

│ Error: invalid ID "<folder ID>;<alert name>"

Steps to Reproduce

  1. Build a config using TF 1.7.1, Grafana 10.2.3 OSS and provider version 2.8.1.
  2. Provision an alert rule
  3. Upgrade the provider to 3.7.0
  4. terraform plan should now fail

Important Factoids

No response

References

No response

julienduchesne commented 3 weeks ago

See https://github.com/grafana/terraform-provider-grafana/releases/tag/v3.0.0. The upgrade procedure is to upgrade to the latest v2, then upgrade to v3.

bixu commented 3 weeks ago

See https://github.com/grafana/terraform-provider-grafana/releases/tag/v3.0.0. The upgrade procedure is to upgrade to the latest v2, then upgrade to v3.

Thanks for the link. We spent a few hours trying to find update notes like that, but somehow missed it. Maybe an UPGRADING.md would be worth having?