Closed aviflax closed 3 years ago
@aviflax Underlying CreateSchemaRegistry
from ccloud actually produces the ””
for Kafka cluster id: https://github.com/cgroschupp/go-client-confluent-cloud/blob/98176441a5a5e49dca8f893bd63c8e9f08be09fd/confluentcloud/schema_registry.go#L109, so this might be ok
Can't find any documentation but looking at some examples it looks like they set the service provider to be all lowercased. Can you try using serviceProvider: "aws"
and see if that perhaps solves your problem?
Hi @emiliza thank you for taking a look, and thanks for the suggestion!
While perhaps that change is indeed necessary, unfortunately it doesn’t seem to be sufficient; the request is still failing:
I’m frustrated that the Confluent Cloud API returns such vague error messages.
If you have any other suggestions, I’d greatly appreciate any further help — thank you!
So, I thought I’d take a closer look at the source code for the Terraform provider that this provider builds on, and look again to see if there are any tests. Last time I looked I didn’t see any tests, but I thought I’d check again and look more closely.
Turns out that while there are very few (only one) .go
files with “test” in their name, there is a test script that runs the example Terraform module. I think that’s why I missed it the first time I looked — because it didn’t occur to me that the example might actually also be a test. (I do think it’s actually quite smart; it’s a way of ensuring that the documentation stays up to date.)
Anyway, I took a closer look at the example declaration of the resource confluentcloud_schema_registry
and thought I’d look for differences between the test/example values used in that file and the values my code was using — as inspired by your suggestion that there might be a problem with the property service_provider
. And I found one! Turns out my problem was specifying the value of location
as eu-central-1
(the ID of the AWS region my cluster is in) — apparently the Confluent Cloud API wants the value of this property to be, in my case, EU
— once I switched it, that worked fine.
This is a little surprising (in a bad way) because the request to create a Kafka cluster also has a property named region
and in that case, the value eu-central-1
works just fine. But I guess that’s something to take up with the maintainers of the API, not with y’all.
So: I’m good! Thanks for the help!
I’m going to leave this open for now, just in case there’s any further follow-up action y’all want to take related to my experience (e.g. maybe contribute better error messages and/or property validation/guidance into the upstream provider) — but feel free to close this whenever y’all want.
Thank you!
Glad this works for you! I'll just mark this as resolved since we're not actively tracking a fix upstream.
I’m trying to provision a Schema Registry in a Confluent Cloud Environment, using this provider, and it’s not working for me.
Steps to reproduce
My resource definition looks like this:
…which I believe is more or less correct, and I expected this to result in a Schema Registry being successfully provisioned in my Confluent Cloud Environment.
Instead, I get this error:
I suspect that the problem is related to the kv pair
"kafka_cluster_id": ""
in the request body, but I can’t say for sure.For now I’ve worked around this with a dynamic provider that invokes the
ccloud
CLI tool, but it’s a ton of code that I’d love to remove from my project at some point.Thank you!