dbt-labs / terraform-provider-dbtcloud

dbt Cloud Terraform Provider
https://registry.terraform.io/providers/dbt-labs/dbtcloud
MIT License
85 stars 19 forks source link

add oauth client/secret to dbt_cloud_connection #69

Closed trunsky closed 2 years ago

trunsky commented 2 years ago

Would it be possible to add oauth_client_id and oauth_client_secret to the dbt_cloud_connection resource?

GtheSheep commented 2 years ago

Yep, giving it a shot right now as it happens, hopefully will update shortly 😺

GtheSheep commented 2 years ago

So I can add it but it doesn't seem to appear in the response from query the connection API, should still be ok to manage it in a basic sense though (though if it gets overridden in the UI then...), if you get a chance and could try querying one of your connections that uses Oauth just to check it definitely isn't coming through that would be much appreciated:

curl -H '{"Content-Type": "application/json", "Authorization": "Token <api_token>"}' https://cloud.getdbt.com/api/v3/accounts/<account_id>/projects/<project_id>/credentials/ 

Though this makes sense as it's credentials I spose!

trunsky commented 2 years ago

Just checked - it's definitely not coming through the /connections get request, I'm guessing because it's a secret

GtheSheep commented 2 years ago

Awesome, thanks! I'll merge the PR for it anyway, as it'll allow managing it in CI-CD, just won't be able to detect if it's been changed in the UI, would that suit your use case?

trunsky commented 2 years ago

I think that's fine - nobody should be touching it in the UI. Thank you!

GtheSheep commented 2 years ago

Released on v0.0.84