Skip to content

stackit_observability_instance - Provider produced inconsistent result after apply #1003

@docbyte86

Description

@docbyte86

Description

With version 0.65.0 (... and 0.66.0) we are getting error:

│ Error: Provider produced inconsistent result after apply
│ 
│ When applying changes to stackit_observability_instance.observability[0],
│ provider "provider[\"registry.opentofu.org/stackitcloud/stackit\"]"
│ produced an unexpected new value: .alert_config: inconsistent values for
│ sensitive attribute.
│ 
│ This is a bug in the provider, which should be reported in the provider's
│ own issue tracker.

Steps to reproduce

Execute tofu apply with terraform code

main.tf

resource "stackit_observability_instance" "observability" {
  project_id                             = var.stackit_project_id
  count                                  = var.apply_obs ? 1 : 0
  name                                   = local.obs_name
  plan_name                              = var.obs_plan
  acl                                    = var.obs_acl
  metrics_retention_days                 = 90
  metrics_retention_days_5m_downsampling = 0
  metrics_retention_days_1h_downsampling = 0
  alert_config                           = local.obs_alert_config
}

locals.tf

  obs_name               = ((var.stage == "sbx") || (var.stage == "poc") ? "obs_${var.appcode}_${var.stage}_${var.branch_id}" : local.obs_name_higher_stages)
  obs_name_higher_stages = lower("obs_${var.appcode}_${var.stage}")
  one_alerting_secret = (
    (var.stage == "sbx") ? data.vault_kv_secret_v2.secrets.data.one_alerting_sbx :
    var.stage == "dev" ? data.vault_kv_secret_v2.secrets.data.one_alerting_dev :
    data.vault_kv_secret_v2.secrets.data.one_alerting_prd
  )
  one_alerting_url = "https://${local.one_alerting_secret}:${local.one_alerting_secret}@api.onealerting.schwarz/v1/alert/prometheus"
  obs_alert_config = {
    route = {
      receiver        = "OneAlertingReceiver"
      group_interval  = "5m"
      group_wait      = "30s"
      repeat_interval = "4h"
    }
    receivers = [
      {
        name = "OneAlertingReceiver"
        webhooks_configs = [
          {
            ms_teams     = false
            url          = local.one_alerting_url
            sendResolved = true
          }
        ]
      }
    ]
  }

variables.tf

variable "obs_plan" {
  description = "Specifies the Observability plan"
  type        = string
  default     = "Observability-Basic-EU01"
}


variable "obs_acl" {
  description = "The access control list for this instance."
  type        = list(string)
  default = [***]
}
  1. Run terraform ...
  2. ...

Actual behavior

See error message

Expected behavior

with v0.64.0

stackit_observability_instance.observability[0]: Creation complete after 7m4s [id=737c622a-28f4-48fb-9c92-497da73928f8,9298fa5d-021c-4513-9739-2432d1c6d953]

Environment

  • OS: python:slim
  • Opentofu version (see terraform --version): 1.10.5
  • Version of the STACKIT Terraform provider: v0.66.0 + v0.65.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions