Closed alex-ld closed 1 year ago
Hey! Thanks for finding this and providing such detail, super helpful, will take a look later today 👌
Hey, think I've tracked this down, for triggers
on the dbt_cloud_job
to be valid, I seem to be requiring all keys are set (rather than defaulting to false), I'll see if I can add a validation func to that resource input and log a better error, that trace was grim 😬 i.e.
triggers = {
github_webhook: false,
git_provider_webhook: false,
schedule: true,
custom_branch_only: false,
}
tbh I thought this was handled, but clearly not, so will add another test also 😞
Hi @GtheSheep thanks for the response. That seems to solve the problem.
Another question related to this resource if you don't mind me reusing this thread:
Where is dbt_cloud_snowflake_credential
actually being used? With this resource created, dbt Cloud still complains about IDE credential not being set.
Credentials Required
You'll need to configure your development credentials to write code in dbt Cloud. For more information, consult the [IDE setup guide](https://docs.getdbt.com/docs/running-a-dbt-project/using-the-dbt-ide/#setting-up-developer-credentials).
Currently, it seems like the only way to provide IDE credentials is via the console.
It is also not used as environment credentials for running job.
This environment does not have any credentials associated with it. Edit the environment to add credentials, then try this job again.
hey @alex-ld - Just gave it a go using the code you provided (with my credentials in place ofc), If I run TF apply then the snowflake credential is found at Account Settings -> Project (the new test one) -> Connection, if I open it up I can see the credentials I provided, is this not what you expected/ is happening for you?
I did notice the line warehouse = local.workspace.warehouse_size
, just wanted to check that's just a weird name? as that should be the warehouse name not the size. Hope that's some help 😸
Thanks for the heads up on the warehouse, I renamed it to warehouse_name
which is more proper.
As for the connection, please see the screenshot. There's no user/pw here. They are in the project environment credential page.
Hmm interesting, presumably you're doing this with an admin level access token? Won't get round to it today but will try out your example again tomorrow and see if I can replicate this
Hey, so after a bit more playing around with the API, credentials just seem to disappear into a bit of an abyss until they're associated with something, like an Environment, where you can then browse the UI for them, otherwise they seem to just come back in the API GET response, otherwise most of the pages show Connection info rather than Credential info
tbh looking into this has made me realise I could learn a bit more about it and ideally refactor how connections/ credentials look in the provider to make it more obvious how the flow should work (the other open issue is about Databricks so v relevant to this)
@GtheSheep I believe in this package you are using the V3 API? To be honest I think dbt Cloud and the API is half-baked, and poorly documented. Even doing click-ops is not clear sometimes, let alone doing IAC.
If you could provide more details or documentations you used to develop this package, I might be able to contribute to this package too.
Hey, yeah it's mostly V3, little bit of V2 in places but yeah it's not been the easiest, in terms of figuring out how things work I either introspect the UI using chrome or something, or use the postman collection https://www.postman.com/dbtlabs/workspace/dbt-cloud-api-documentation/overview
Quite a lot involves trial and error of the read/ update/ create/ delete requests in a notebook to get all the args, etc, as it expects
Any help would be hugely appreciated!
But thanks again for bringing this up, has been a while since the initial credential/ connection stuff went in, was v specific to my use case and for sure could do with a revisit/ better docs on how it mimics the UI flow
This issue is stale because it has been open for 30 days with no activity.
This issue is stale because it has been open for 45 days with no activity.
This issue is stale because it has been open for 45 days with no activity.
This issue was closed because it has been inactive for 7 days since being marked as stale.
Context: I am trying to define dbt cloud resources:
terraform apply threw an error when I provide the
password
parameter todbt_cloud_snowflake_credential
, and ran fine without it.Code:
Terraform plan:
Error log: