terraform-provider-grafana icon indicating copy to clipboard operation
terraform-provider-grafana copied to clipboard

Folder resource: Provider produced inconsistent result after apply

Open miguelglopes opened this issue 3 years ago • 0 comments

Terraform Version

  • Terraform: 1.3.0
  • Terraform Grafana Provider: 1.24.0 and 1.28.2
  • Grafana: Grafana Cloud

Affected Resource(s)

  • grafana_folder

Terraform Configuration Files

terraform {
  required_providers {
    grafana = {
      source  = "grafana/grafana"
      version = "1.28.2"
    }
  }
}
provider "grafana" {
  # this is for grafana apis. Required for adding dashboards
  org_id = var.GRAFANA_ORG
  url    = var.GRAFANA_URL
  auth   = var.GRAFANA_AUTH

  # this is for synthetic monitoring. required for adding synthetic monitor
  sm_url          = var.GRAFANA_SM_URL
  sm_access_token = var.GRAFANA_SM_TOKEN
}
resource "grafana_folder" "folder_test" {
  title = "test"
}

resource "grafana_dashboard" "dashboard_test" {
  config_json = file("${path.module}/test.json")
  overwrite   = true
  folder      = grafana_folder.folder_test.id
}

Debug Output

image

Panic Output

image

Expected Behavior

Should have created the folder and the dashboard inside the folder.

Actual Behavior

Folder is created but terraform fails at that step, and doesn't create the dashboard. image

Steps to Reproduce

  1. terraform apply

miguelglopes avatar Sep 22 '22 17:09 miguelglopes