Closed anaghshineh closed 9 months ago
Hi!
Have you checked dbtcloud_job
and the fields under triggers
?
I believe that setting the following should work (just tweak the custom branch field according to your needs):
triggers = {
"custom_branch_only" : true,
"github_webhook" : true,
"git_provider_webhook" : true,
"schedule" : false
}
Let me know if it works!
Oh, great - I'll give this a shot and follow up within a week or so. Thank you!
Hey, @b-per! I finally got around to testing this out. I was able to create a job that runs on pull request, but I'm unfortunately not seeing a way to set the deferral environment. See the screenshot - it's defaulting to setting no deferral environment. Would be great for this to be configurable.
I think the create job endpoint needs to be updated to allow for this, and then the Terraform provider code updated to support that?
Thank you ❤️
The API and the latest version of the provider let you do it. If you look here https://registry.terraform.io/providers/dbt-labs/dbtcloud/latest/docs/resources/job#deferring_environment_id , you have the ability to provide which environment ID the job should defer to.
Let me know if it works!
Ah, totally missed that. Thanks a bunch - I'm going to give this a try in the next few days.
Feel free to reopen if this is not working as expected
Do we have a way to create jobs of Continuous Integration type via this provider? Doesn't look like it based on the docs/API endpoints, so wanted to put this forth as a feature request! Would love to use this provider to automate the creation of an environment with CI jobs.