terraform-provider-digitalocean
terraform-provider-digitalocean copied to clipboard
digitalocean_database_cluster kafka missing attributes
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
- 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
}
- See terraform state.
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.
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.
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.