Mongey / terraform-provider-kafka

Terraform provider for managing Apache Kafka Topics + ACLs
MIT License
519 stars 129 forks source link

This is not the correct controller for this cluster. #247

Open sdahlbac opened 2 years ago

sdahlbac commented 2 years ago

I might be doing something stupid, but:

  required_providers {
    ...
    kafka = {
      source  = "Mongey/kafka"
      version = "0.4.3"
    }
}
provider "kafka" {
  bootstrap_servers = split(",", data.tfe_outputs.base.values.kafka-url)
  sasl_username     = data.onepassword_item_login.kafka_admin.username
  sasl_password     = data.onepassword_item_login.kafka_admin.password
  sasl_mechanism    = "plain"
  tls_enabled       = true
  ca_cert           = data.onepassword_item_document.ca-cert.content
  timeout           = 10
}

where kafka url is kafka-0.kafka-headless.core.svc.cluster.local:9094,kafka-1.kafka-headless.core.svc.cluster.local:9094,kafka-2.kafka-headless.core.svc.cluster.local:9094

resource "kafka_topic" "_schemas" {
  name               = "_schemas"
  partitions         = 1
  replication_factor = 3
  config = {
    "cleanup.policy" = "compact"
  }
}

results in

│ Error: kafka server: This is not the correct controller for this cluster.
│
│   with kafka_topic._schemas,
│   on kafka-topics.tf line 1, in resource "kafka_topic" "_schemas":
│    1: resource "kafka_topic" "_schemas" {
xoanmi commented 2 years ago

I'm facing the same issue. Did you find any solution @sdahlbac?

sdahlbac commented 2 years ago

Possibly it was due to the topic already existing, but not certain