-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Circular dependency: project + connection + repository #67
Comments
Hey, this looks strange, really shouldn't be a cyclical issue here as Project -> Connection -> Repo is the standard startup flow for dbt Cloud. |
Thank you @GtheSheep , this is also strange to me as I've always seen the dependency as
The error changes to this, which is pretty much the same:
I think it comes down to the fact that:
Unfortunately I don't see how this could work without causing the circular dependency given that |
Ahh ok, that makes sense, so thinking about it, the flow in dbt Cloud is probably something like: And hence the issue is that this provider doesn't mimic that flow when it's all new (essentially, 3 creates), so you'd have to create them all first, then run TF again with the connection_id and repository_id added to the project resource, which is probably the workaround? I'll have a think about how I can structure the project resource to capture this, don't have a fix off the top of my head 😅 But thank you for finding this, great spot! |
Thank you for clarifying 👍🏽 |
Hey, @felipefrancisco - so I've had a bit of a look around about this kind of thing, seems like there's a few examples + a discussion here. Seems like one example of a fix is to design the relationships between project <-> repo and project <-> connection as separate resources such that Terraform orders them as we want, i.e. |
Amazing, thank you for looking further into this @GtheSheep! Much appreciated! Given the project's repo and the project's connection can only be linked after the Project has been created, it would indeed make sense to model them as separate resources that would link to the project 👍🏽 |
Hey @felipefrancisco - Just releasing a version with the 2 new resources dbt_cloud_project_connection and dbt_cloud_project_repository, will follow up with an example on spinning up all resources described above, but should've solved the circular issue now 🤞 thanks again for finding this! (I'll reopen this issue if needed) |
Hey @GtheSheep - thank you very much, this repository is very helpful.
I'm trying to create a
project
, aconnection
and arepository
using the resources from this provider, without having to take manual steps via the UI. My setup currently looks like this:When I
plan
, unfortunately, I get this error:Am I right to understand that even though the project has support for a repository and connection, we cannot use them?
The text was updated successfully, but these errors were encountered: