grafana / terraform-provider-grafana

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

[Bug]: Error: Provider produced inconsistent final plan - grafana_contact_point #1526

Closed evertonspader-tomtom closed 3 months ago

evertonspader-tomtom commented 4 months ago

Terraform Version

v1.8.0

Terraform Grafana Provider Version

v2.18.0

Grafana Version

No response

Affected Resource(s)

Terraform Configuration Files

resource "grafana_contact_point" "team_pagerduty" {
  name = "PagerDuty critical ${var.environment}-tf"

  pagerduty {
    integration_key = data.azurerm_key_vault_secret.autostream_pagerduty_integration_key.value
    settings = {
      uploadImage = "true"
      autoResolve = "true"
    }
  }
}

Expected Behavior

No changes should be suggested or errors be seen after first successful apply and provisioning of resources

Actual Behavior

The resource is already provisioned but running a terraform apply yields in errors pointing to bugs in the provider. Running the apply command again succeeds with no changes.

│ Error: Provider produced inconsistent final plan
│ 
│ When expanding the plan for grafana_contact_point.team_pagerduty to include new values learned so far during apply, provider "registry.terraform.io/grafana/grafana" produced an invalid new
│ value for .pagerduty: planned set element cty.ObjectVal(map[string]cty.Value{"class":cty.StringVal(""), "client":cty.StringVal(""), "client_url":cty.StringVal(""), "component":cty.StringVal(""),
│ "details":cty.NullVal(cty.Map(cty.String)), "disable_resolve_message":cty.False, "group":cty.StringVal(""), "integration_key":cty.UnknownVal(cty.String),
│ "settings":cty.MapVal(map[string]cty.Value{"autoResolve":cty.StringVal("true"), "uploadImage":cty.StringVal("true")}), "severity":cty.StringVal(""), "source":cty.StringVal(""),
│ "summary":cty.StringVal(""), "uid":cty.UnknownVal(cty.String)}) does not correlate with any element in actual.
│ 
│ This is a bug in the provider, which should be reported in the provider's own issue tracker.
╵

Steps to Reproduce

  1. terraform apply - the errors will be seen
  2. terraform apply - no changes will be perceived

Important Factoids

No response

References

No response

julienduchesne commented 3 months ago

Is this on Grafana Cloud and is this still happening? I've tried to reproduce it on Grafana 10 and 11 (Cloud) and I'm unable to do so

julienduchesne commented 3 months ago

Closing because I'm unable to reproduce, and this may be resolved with the new major version. I'd recommend you try that one. Feel free to re-open if this is still happening!