SchwarzIT / terraform-provider-stackit

Community-maintained STACKIT Terraform provider
Apache License 2.0
18 stars 6 forks source link

Invalid return value for `stackit_postgres_credential.username` #97

Closed JorTurFer closed 1 year ago

JorTurFer commented 1 year ago

Hello, I'm using stackit_postgres_credential and trying to get the connection data but it looks that username return the database_name instead of the username.

image

Having access to both values would be nice as the db name is something internal unrelated with the server name

do87 commented 1 year ago

thanks for your report, I'll look into it

do87 commented 1 year ago

the provider is using Name as the username https://github.com/SchwarzIT/terraform-provider-stackit/blob/main/stackit/internal/resources/data-services/credential/helpers.go#L23

I'll raise a question to DSA team if that's correct or not, as the client (generated from their swagger spec) doesn't provide a Username field

----- Update -----

Thanks to DSA team's super quick support, I can report that the provided name field is indeed the database name for all DSA services.

The API returns username but it's missing in the spec. Once the spec is updated I'll update the code from our side too :)

do87 commented 1 year ago

bug should be fixed in v1.11.8 @JorTurFer

JorTurFer commented 1 year ago

Thanks! We are using uri because our app also supports that format, I won't be able to test the fix, but thanks anyway :)