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

SASL no TLS and AWS MSK #258

Closed
mattia-crypto opened this issue May 23, 2022 · 6 comments
Closed

SASL no TLS and AWS MSK #258

mattia-crypto opened this issue May 23, 2022 · 6 comments

Comments

@mattia-crypto
Copy link

mattia-crypto commented May 23, 2022

Hi,

I am unable to use the provider with an AWS MSK cluster configured with SASL:

terraform {
  required_version = ">=1.1.5"
  required_providers {
    kafka = {
      source = "Mongey/kafka"
    }
  }
}

provider "kafka" {
  bootstrap_servers = ["some-host:9096"]
  sasl_username     = var.terraform_sasl_username
  sasl_password     = var.terraform_sasl_password
  sasl_mechanism    = "scram-sha512"
  tls_enabled       = false
}

I keep seeing the following on terraform apply:

Error: kafka: client has run out of available brokers to talk to: unexpected EOF

when trying to create:

resource "kafka_topic" "test" {
  name               = "test"
  replication_factor = 3
  partitions         = 1

}
@antontreushchenko
Copy link

antontreushchenko commented May 24, 2022

Try to use

provider "kafka" {
  bootstrap_servers = ["some-host:9096"]
  sasl_username     = var.terraform_sasl_username
  sasl_password     = var.terraform_sasl_password
  sasl_mechanism    = "scram-sha512"
  tls_enabled       = true
  skip_tls_verify   = false
}

@mattia-crypto
Copy link
Author

@antontreushchenko Same problem unfortunately

@antontreushchenko
Copy link

antontreushchenko commented May 24, 2022

image
Untitled
Untitled

mattia-crypto I have such a security configuration for the cluster, if yours is not like this, then try to do this

@mattia-crypto
Copy link
Author

Thanks. However, I see from your screenshot you have unauthenticated access and Plaintext between clients and brokers enabled. Unfortunately, I cannot have that.

@mattia-crypto
Copy link
Author

@antontreushchenko on second note, I noticed I had overlooked one of the params in the config you sent. I managed to make it work now with this:

provider "kafka" {
  bootstrap_servers = ["some-host:9096"]
  sasl_username     = var.terraform_sasl_username
  sasl_password     = var.terraform_sasl_password
  sasl_mechanism    = "scram-sha512"
  tls_enabled       = true
  skip_tls_verify   = false
}

@rssaini01
Copy link

I'm bit curious to know,, why you guys are using private port like 9096 ?? it's a private endpoint port for SASL/SCRAM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants