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

digitalocean_database_cluster kafka missing attributes #1121

Open
SkeLLLa opened this issue Mar 5, 2024 · 3 comments
Open

digitalocean_database_cluster kafka missing attributes #1121

SkeLLLa opened this issue Mar 5, 2024 · 3 comments
Labels
api-parity Feature supported in the DigitalOcean API not yet implemented in Terraform bug

Comments

@SkeLLLa
Copy link

SkeLLLa commented Mar 5, 2024

Bug Report


Describe the bug

Resource digitalocean_database_cluster for kafka cluster missing many attributes like:

"port": 0,
"private_uri": "",
"uri": "",

Affected Resource(s)

Expected Behavior

All resources include port, uri and private_uri should be present

Actual Behavior

Port attribute is wrong, other attributes missing

Steps to Reproduce

  1. Use example from docs:
resource "digitalocean_database_cluster" "kafka-example" {
  name       = "example-kafka-cluster"
  engine     = "kafka"
  version    = "3.5"
  size       = "db-s-2vcpu-2gb"
  region     = "nyc1"
  node_count = 3
}
  1. See terraform state.
@SkeLLLa SkeLLLa added the bug label Mar 5, 2024
@danaelhe danaelhe added the api-parity Feature supported in the DigitalOcean API not yet implemented in Terraform label Mar 5, 2024
@danaelhe
Copy link
Member

danaelhe commented Mar 5, 2024

Thank you for bringing this to our attention.

For Kafka, we do not expect those attributes and the provider shouldn't have returned them at all. I've created a ticket internally for our team to ensure the provider only returns the attributes expected from Kafka. I'll keep this issue open until it is addressed.

@SkeLLLa
Copy link
Author

SkeLLLa commented Mar 14, 2024

If the provider doesn't return them, how, for example port will be known? At least it should be returned, otherwise it will require hardconding it on a client side and if there will be changed in DO kafka deployment (e.g. "private port" will change or so) it will introduce a risk and will require extra testing.

Therefore even if port value will be defined on provider level, then two other variables will be easy to construct like
uri = "${host}:${port}" and private_uri = "${private_host}:${port}", which will provide consistency across all databases under digitalocean_database_cluster resource.

@danaelhe
Copy link
Member

If the provider doesn't return them, how, for example port will be known?

Apologies, I misspoke. The provider should return these, however, the defaults certificate -> 25062 and sasl -> 25073 are constant for all DBaaS Kafka deployments. For the time being, you can use these. It's important to note that because Kafka has two different auth methods/uris/ports there's really no way of getting around making a choice at some point.

The database team has made a ticket for the API layer to set the default port to the SASL port to address this and avoid having an empty port value. In the meantime, I'm going to add some documentation around this as well. I also like your suggestion:

uri = "${host}:${port}" and private_uri = "${private_host}:${port}", which will provide consistency across all databases under digitalocean_database_cluster resource.

We can look into this more as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-parity Feature supported in the DigitalOcean API not yet implemented in Terraform bug
Projects
None yet
Development

No branches or pull requests

2 participants