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

Grafana folder permission bug in provider!

Open kristiqato opened this issue 3 years ago • 3 comments

Terraform Version

  • Terraform: ">= 0.13"
  • Terraform Grafana Provider: "1.24.0"
  • Grafana: v9.0.2

Please list the resources as a list, for example:

  • grafana_folder
  • grafana_folder_permission

If this issue appears to affect multiple resources, it may be an issue with Terraform's core, so please mention this.

Terraform Configuration Files

resource "grafana_folder" "collection" { uid = "finance-data-folder" title = "Finance Data Quality" }

resource "grafana_folder_permission" "collectionPermission" { folder_uid = "finance-data-folder" permissions { role = "Editor" permission = "Edit" } } }


### Debug Output

│ Error: Provider produced inconsistent result after apply
│ 
│ When applying changes to grafana_folder.collection, provider
│ "provider[\"registry.terraform.io/grafana/grafana\"]" produced an
│ unexpected new value: Root resource was present, but now absent.
│ 
│ This is a bug in the provider, which should be reported in the provider's
│ own issue tracker.

When trying to create a folder and add permissions. Normally it should create a folder with that permission. 
But actually this error happened.

### Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
1. terraform init
2. terraform apply 
3. terraform build


kristiqato avatar Jul 20 '22 12:07 kristiqato

Same issue for me for the same versions, looking forward to the new release of provider with updated grafana go client, maybe this will help. Btw, does anybody knows, how I can try provider from github master?

eagleeye avatar Jul 26 '22 16:07 eagleeye

Same for me, same versions, just creating the folder, switched to creating folder manually and using a data resource for the moment

markspace avatar Aug 01 '22 10:08 markspace

I'm unable to reproduce this. Is this the full Terraform configuration?

julienduchesne avatar Aug 23 '22 20:08 julienduchesne

This now works for me with Terraform Grafana Provider: "1.28.0" with an admin level token

markspace avatar Sep 11 '22 00:09 markspace

Thanks @markspace. I'll close this but if anyone still has the issue, feel free to comment here and I'll reopen it!

julienduchesne avatar Sep 11 '22 22:09 julienduchesne

I'm experiencing the same error with provider 1.32.1 (same problem with 1.28.0)

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

provider "grafana" { 
  url  = "<redacted>"
  auth = "<redacted>"
}


resource "grafana_folder" "test-folder-30" {
  uid   = "test-folder-uid-030"
  title = "Terraform Test Folder 030"
}

terraform apply creates the folder but ends up in error │ Error: Provider produced inconsistent result after apply

totomz avatar Dec 15 '22 13:12 totomz

Hey, I think this was actually a duplicate of https://github.com/grafana/terraform-provider-grafana/issues/665. Creating folders with an editor token, not an admin seems to not work for Terraform

julienduchesne avatar Dec 15 '22 13:12 julienduchesne