Error: Provider produced inconsistent final plan: Azure External Helm Chart deployment Bag

Terraform Version

Terraform v1.4.6

Terraform Configuration Files

resource "helm_release" "ingress-nginx-controller" {
  count = try(var.helm_config.ingress_nginx.install, false) == true ? 1 : 0

  name             = "ingress-nginx"
  chart            = var.external_helm_chart == true ? "/ci/configuration/${var.environment_name}/helm_charts/ingress-nginx" : "./helm-module/ingress-nginx/chart"
  #chart            = "./helm-module/ingress-nginx/chart"
  namespace        = "ingress-basic"
  create_namespace = true
helm:
  aks_name: "test-AKS"
  ingress_nginx:
    install: true
    replicas: 2
    DaemonSet: true
    registry: artifactorycn.company.com
    controller_tag: v1.9.6
    webhook_tag: v1.3.0
    external_helm_chart: true

Debug Output


│ Error: Provider produced inconsistent final plan

│ When expanding the plan for
│ module.helm.helm_release.ingress-nginx-controller[0] to include new values
│ learned so far during apply, provider
│ “Terraform Registry” produced an invalid new value for
│ .version: was known, but now unknown.

│ This is a bug in the provider, which should be reported in the provider’s
│ own issue tracker.

Expected Behavior

External Helm Chart with expected version should be deployed.

Actual Behavior

Error: Provider produced inconsistent final plan

External Helm Chart not deployed

Steps to Reproduce

  1. terraform init
  2. terraform plan
  3. terraform apply

Additional Context

The correct version of Helm Chart cannot be installed. I get the error:

Error: Provider produced inconsistent final plan

│ When expanding the plan for
│ module.helm.helm_release.ingress-nginx-controller[0] to include new values
│ learned so far during apply, provider
│ “Terraform Registry” produced an invalid new value for
│ .version: was known, but now unknown.

│ This is a bug in the provider, which should be reported in the provider’s
│ own issue tracker.