Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Terraform always wants to recreate HDInsight Kafka Cluster #4485

Closed
Djiit opened this issue Oct 2, 2019 · 4 comments
Closed

Terraform always wants to recreate HDInsight Kafka Cluster #4485

Djiit opened this issue Oct 2, 2019 · 4 comments

Comments

@Djiit
Copy link
Contributor

Djiit commented Oct 2, 2019

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform (and AzureRM Provider) Version

Affected Resource(s)

  • azurerm_hdinsight_kafka_cluster

Terraform Configuration Files

resource "azurerm_hdinsight_kafka_cluster" "kafka-hdi_cluster" {
  name                = "mykafka"
  resource_group_name = azurerm_resource_group.kafka-resource_group[0].name
  location            = azurerm_resource_group.kafka-resource_group[0].location
  cluster_version     = "4.0"
  tier                = "Standard"

  component_version {
    kafka = "2.1"
  }

  gateway {
    enabled  = true
    username = module.vault.secrets["kafka-gateway-username"].value
    password = module.vault.secrets["kafka-gateway-password"].value
  }

  storage_account {
    storage_container_id = azurerm_storage_container.kafka-storage_container.id
    storage_account_key  = azurerm_storage_account.kafka-storage_account.primary_access_key
    is_default           = true
  }

  roles {
    head_node {
      vm_size  = "Standard_D3_V2"
      username = "obfuscated"
      password = "obfuscated"
    }

    worker_node {
      vm_size                  = "Standard_D3_V2"
      username                 = "obfuscated"
      password                 = "obfuscated"
      number_of_disks_per_node = 3
      target_instance_count    = 3
    }

    zookeeper_node {
      vm_size  = "Standard_D3_V2"
      username = "obfuscated"
      password = "obfuscated"
    }
  }
}

Expected Behavior

The resource should be left untouched., the Apply output should be green.

Actual Behavior

Terraform tells me it needs to recreate the resource because of some keys I didn't set 👍

  # azurerm_hdinsight_kafka_cluster.kafka-hdi_cluster must be replaced
-/+ resource "azurerm_hdinsight_kafka_cluster" "kafka-hdi_cluster" {
      ~ cluster_version     = "4.0.1000.1" -> "4.0"
      ~ https_endpoint      = "obfuscated.azurehdinsight.net" -> (known after apply)
      ~ id                  = "obfuscated" -> (known after apply)
        location            = "westeurope"
        name                = "mykafka"
        resource_group_name = "obfuscated"
      ~ ssh_endpoint        = "obfuscated.azurehdinsight.net" -> (known after apply)
      ~ tier                = "standard" -> "Standard"

        component_version {
            kafka = "2.1"
        }

      ~ gateway {
            enabled  = true
          ~ password = (sensitive value)
            username = "adminhdi"
        }

      ~ roles {
          ~ head_node {
                password = (sensitive value)
              - ssh_keys = [] -> null
                username = "adminhdi"
                vm_size  = "Standard_D3_V2"
            }

          ~ worker_node {
              - min_instance_count       = 0 -> null
                number_of_disks_per_node = 3
                password                 = (sensitive value)
              - ssh_keys                 = [] -> null
                target_instance_count    = 3
                username                 = "adminhdi"
                vm_size                  = "Standard_D3_V2"
            }

          ~ zookeeper_node {
                password = (sensitive value)
              - ssh_keys = [] -> null
                username = "adminhdi"
                vm_size  = "Standard_D3_V2"
            }
        }

        storage_account {
            is_default           = true
            storage_account_key  = (sensitive value)
            storage_container_id = "https://onediorkafkastaging.blob.core.windows.net/hdinsight"
        }
    }

What I tried :

  • set the ssh_keys to [] but with no luck (you can't define username/password AND ssh_keys).

Steps to Reproduce

  1. Define an HDI Kafka cluster.
  2. terraform apply
  3. terraform apply again
  4. Terraform will tell you it needs to recreate the HDI cluster.
@tombuildsstuff
Copy link
Member

hey @Djiit

Thanks for opening this issue.

Taking a look into this, this appears to have been fixed via #4489, which is due to a change in the way the API responds (it now returns "*****" for the "password" field, regardless of the value, so Terraform shows a diff/forces a new resource since this doesn't match the definition in code and it's not possible to change the password in the API).

Since this has been fixed via #4489 which will ship as a part of v1.35 I'm going to close this issue for the moment - but if you're still seeing this issue after upgrading to v1.35 please let us know and we'll take another look :)

Thanks!

@Djiit
Copy link
Contributor Author

Djiit commented Oct 3, 2019 via email

@ghost
Copy link

ghost commented Oct 4, 2019

This has been released in version 1.35.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example:

provider "azurerm" {
    version = "~> 1.35.0"
}
# ... other configuration ...

@ghost
Copy link

ghost commented Mar 29, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!

@ghost ghost locked and limited conversation to collaborators Mar 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants