stackit_observability_instance - Provider produced inconsistent result after apply
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 = [***]
}
- Run
terraform ... - ...
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
@docbyte86 Thank your for the report. We'll take a look at it.
Hi, I also could reproduce the issue. This is I think due to that send_resolved has no default value. @docbyte86 I also think it should be send_resolved = true at least that's what resolved the issue for me. https://github.com/stackitcloud/terraform-provider-stackit/pull/935. Also this is then a breaking upgrade.
Hi, I got the same error on v0.68.0. And it's definitely the variable in the receiver URL. I removed the variable and paste the value direct in the string. It worked without the error.
alert_config = {
receivers = [
{
name = "OneAlertingReceiver"
webhooks_configs = [
{
send_resolved = true
url = "https://${var.onealerting_sourcekey}:${var.onealerting_sourcekey}@api.onealerting.schwarz/v1/alert/prometheus"
}
]
}
]
route = {
receiver = "OneAlertingReceiver"
repeat_interval = "4h" # How long to wait before sending a notification again if it has already been sent successfully for an alert. Default 4h
}
}
Terraform apply throws the error but it is configured correct in Observability. I checked it with the GET alertconfigs API call.
We are running into the same problem. @rubenhoenle Do you have any ETA?