upstash / terraform-provider-upstash

MIT License
22 stars 4 forks source link

Resource "upstash_kafka_credential" returns wrong username as read-only output #23

Closed jalorenz closed 1 year ago

jalorenz commented 1 year ago

We noticed that the "upstash_kafka_credential" resource returns a wrong value for the read only property "username". It does not match the username that can be found in the frontend UI (console.upstash.com).

Version: 1.2.5

burak-upstash commented 1 year ago

Hello, @jalorenz We are checking it. Thanks for the issue.

burak-upstash commented 1 year ago

hey @jalorenz, we have fixed the issue, now both the ui and the terraform provider should showcase the same username. Thanks for the issue, again

jalorenz commented 1 year ago

@burak-upstash But no new version of the provider is required? 1.2.5 is still the current version

burak-upstash commented 1 year ago

1.2.5 should work fine, yes. Just reapply, and you should be fine :) We did some changes on api level

jalorenz commented 1 year ago

@burak-upstash

main.tf:

resource "upstash_kafka_credential" "kafka-credentials" {
  cluster_id      = data.upstash_kafka_cluster_data.dev-cluster.cluster_id
  credential_name = "${var.deployment}-kafka-credentials"
  topic           = var.deployment == "dev" ? "dev-*" : "${var.deployment}-*"
  permissions     = "ALL"
}

outputs.tf:

output "upstash_kafka_username" {
  value = upstash_kafka_credential.kafka-credentials.username
}

Still produces another value than the UI. Terraform produces a username which is a substring of the cluster url.

burak-upstash commented 1 year ago

That is interesting. Can you try creating a dummy credential from scratch? I am suspecting since there is no change made on the configuration, it doesn't think it should re-fetch resource data from the api. If the fresh one works, you can update your config or try -replace tag while applying

jalorenz commented 1 year ago

@burak-upstash Works, thanks