terraform-provider-stackit icon indicating copy to clipboard operation
terraform-provider-stackit copied to clipboard

`stackit_mongodbflex_user`: Host should return just the host

Open JorTurFer opened this issue 1 year ago • 4 comments

host field returns the connection data:

 + mongodb_host = "mongodb://fake:*******@s-xxxx-xxxx-xxx.mongodb.eu01.onstackit.cloud:27017/stackit?authSource=stackit&tls=true&authMechanism=SCRAM-SHA-256"

This isn't always enough as I can require to change some connection parameters and now I can't.

The only option to have the host right now is doing

"s-${stackit_mongodbflex_instance.instance.instance_id}.mongodb.eu01.onstackit.cloud"

This works as a workaround but in the mid/long term, having a field for recovering the server host only would be nice as it will rely on the terrform provider to generate the correct host instead of by myself. As user, probably I won't be aware about related changes and upgrading the provider could be always good.

JorTurFer avatar Feb 08 '24 15:02 JorTurFer

In the same way, the host with **** hiding the secret doesn't makes sense as I can't use it for anything without adding more logic on top of it

JorTurFer avatar Feb 09 '24 08:02 JorTurFer

Hello! Thanks for opening the issue We'll double-check what's the usecase for showing the connection parameters, and apply this if it's a better suit

hcsa73 avatar Feb 09 '24 10:02 hcsa73

I wanted to report this issue too, so it seems to still exist. But I also discovered a (maybe) related issue. According to the documentation the stackit_mongodbflex_user should have a field uri. That field does not exist it seems. Could it be that the current 'host' value should be uri and host is missing?

FlrnFrmm avatar Sep 05 '24 11:09 FlrnFrmm

We introduced the uri field in the release v0.30.0 but it is only set upon creation, so if you have an existing resource it is not updated.

Regarding the host field, we are checking with MongoDBFlex how we can properly fix it. We'll keep you updated on the status

vicentepinto98 avatar Sep 05 '24 13:09 vicentepinto98