coralogix / terraform-provider-coralogix

Terraform provider for Coralogix
https://registry.terraform.io/providers/coralogix/coralogix
Apache License 2.0
11 stars 9 forks source link

Error with variable with label fliter variable_name and string_value #280

Open tifennlegoff opened 4 weeks ago

tifennlegoff commented 4 weeks ago

Hey, I have an error when we added variable who use both string_value and variable_name with terraform apply (but not with plan)

Affected Resource(s)

Terraform Configuration Files

Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.

variables = [
{
    name         = "topic_in"
    display_name = "Topic in"
    definition = {
      multi_select = {
        source = {
          query = {
            query = {
              metrics = {
                label_value = {
                  metric_name  = {
                    string_value = "kafka_info_total"
                  }
                  label_name   = {
                    string_value = "input"
                  }
                  label_filter = [
                    {
                      label = "kubernetes_namespace"
                      operator = {
                        string_value = "pipeline-${var.env}"
                      }
                    }, {
                      label = "app"
                      operator = {
                        variable_name = "app"
                      }
                    }
                  ]
                }
              }
            }
          }
        }
        values_order_direction = "asc"
      }
    }
  }
}

Debug Output

Panic Output

Expected Behavior

Actual Behavior

We have this error when Terraform Apply

Error: Provider produced inconsistent result after apply
When applying changes to
module.enrichment_pipeline_dashboards_staging_hydrogen.coralogix_dashboard.coreplatform_enrichment_pipeline[0],
provider "provider[\"registry.terraform.io/coralogix/coralogix\"]" produced
an unexpected new value:
.variables[0].definition.multi_select.source.query.query.metrics.label_value.label_filters:
was null, but now
cty.ListValEmpty(cty.Object(map[string]cty.Type{"label":cty.Object(map[string]cty.Type{"string_value":cty.String,
"variable_name":cty.String}),
"metric":cty.Object(map[string]cty.Type{"string_value":cty.String,
"variable_name":cty.String}),
"operator":cty.Object(map[string]cty.Type{"selected_values":cty.List(cty.Object(map[string]cty.Type{"string_value":cty.String,
"variable_name":cty.String})), "type":cty.String})})).
This is a bug in the provider, which should be reported in the provider's own issue tracker.

Steps to Reproduce

  1. Add variable with two label filters
  2. terraform apply

Important Factoids

References

Community Note

celaus commented 3 days ago

Hi - can you please include the full dashboard (or an abbreviated version that reproduces the issue)