confluentinc / terraform-provider-confluent

Terraform Provider for Confluent
Apache License 2.0
31 stars 64 forks source link

cluster bootstrap_server is missing SASL_SSL:// prefix #118

Closed S1M0NM closed 2 years ago

S1M0NM commented 2 years ago

Hello there, today i tried creating a cluster link between two dedicated clusters. One got a private link connection and the other one got public internet access. While i followed the example on how to create a source initiated cluster link i found an error within on of our clusters that was also created using terraform.

I followed the example and terraform plan threw this error message:

Error: invalid value for source_kafka_cluster.0.bootstrap_endpoint (the bootstrap endpoint must start with 'SASL_SSL://')

So i tried to switch to the rest_endpoint which worked during terraform plan but failed during apply:

Error: error creating Cluster Link: "bootstrap_endpoint" must be specified for "source_kafka_cluster"

So i checked both clusters using the confluent kafka cluster describe command in the cli and noticed that the source cluster i tried to use is missing the SASL_SSL:// Prefix while the other cluster got it. Only difference between the two clusters is that one was created with an earlier version of the terraform provider and uses private endpoint connection while the second one was created a few weeks ago and got public internet access.

| Endpoint | SASL_SSL://xxx-xxxxx.westeurope.azure.confluent.cloud:9092 | | Endpoint | xxx-xxxxxx-xxxxxx.westeurope.azure.glb.confluent.cloud:9092 |

How is it possible that one cluster got this prefix and another on is missing it? How can this issue be fixed?

linouk23 commented 2 years ago

πŸ‘‹ @S1M0NM, thanks for creating an issue!

That looks like a backend issue. Is it accurate that SASL_SSL://xxx-xxxxx.westeurope.azure.confluent.cloud:9092 is a bootstrap endpoint of the public dedicated cluster and xxx-xxxxxx-xxxxxx.westeurope.azure.glb.confluent.cloud:9092 is a bootstrap endpoint of the PL cluster?

linouk23 commented 2 years ago

As a short term fix for

Error: invalid value for source_kafka_cluster.0.bootstrap_endpoint (the bootstrap endpoint must start with 'SASL_SSL://')

we would suggest prefixing source_kafka_cluster.0.bootstrap_endpoint manually with `SASL_SSL://'. Let me know if it works.

format("%s%s", "SASL_SSL://", source_kafka_cluster.0.bootstrap_endpoint)
S1M0NM commented 2 years ago

πŸ‘‹ @S1M0NM, thanks for creating an issue!

That looks like a backend issue. Is it accurate that SASL_SSL://xxx-xxxxx.westeurope.azure.confluent.cloud:9092 is a bootstrap endpoint of the public dedicated cluster and xxx-xxxxxx-xxxxxx.westeurope.azure.glb.confluent.cloud:9092 is a bootstrap endpoint of the PL cluster?

Yes, the private-link cluster is missing the prefix and also got the .glb part in its adress.

As a short term fix for


Error: invalid value for source_kafka_cluster.0.bootstrap_endpoint (the bootstrap endpoint must start with 'SASL_SSL://')

we would suggest prefixing source_kafka_cluster.0.bootstrap_endpoint manually with `SASL_SSL://'. Let me know if it works.


format("%s%s", "SASL_SSL://", source_kafka_cluster.0.bootstrap_endpoint)

That worked πŸ‘πŸΌ

linouk23 commented 2 years ago

@S1M0NM we've just released version 1.9.0 of TF Provider for Confluent that should fix this input validation problem (using this hacky format() should no longer be required for new clusters links), feel free to reopen if you manage to reproduce the issue.