Closed waligob closed 9 months ago
Hi @waligob ! Thanks for raising this issue and adding all those details.
I think that this is related to the improvements the team is releasing around CI where deferral can then be done at the environment level rather than at the job level.
I will most likely need to release a new version of the provider allowing deferral to be made at the env_id rather than the job_id. I am reaching out to the internal engineering team and will provide updates here.
In the meantime, could you please raise a support ticket sending an email to support@getdbt.com , mentioning this ticket?
In the meantime, could you please raise a support ticket sending an email to support@getdbt.com , mentioning this ticket?
@b-per I just emailed support. Thank you!
Support ticket number is 54243.
Thanks, I asked the team to revert to the older behaviour temporarily on your account until I release an update to the Terraform provider.
The team moved your account back to the previous behaviour for now. I will release a new version of the provider early next week most likely allowing people to set the deferral at the environment level.
The team moved your account back to the previous behaviour for now. I will release a new version of the provider early next week most likely allowing people to set the deferral at the environment level.
Thanks, @b-per! I've confirmed that we're successfully able to run terraform apply
against the resource now:
Terraform will perform the following actions:
# dbt_cloud_job.cicd will be updated in-place
~ resource "dbt_cloud_job" "cicd" {
~ deferring_job_id = 0 -> 225359
id = "225361"
name = "CICD"
# (16 unchanged attributes hidden)
}
Plan: 0 to add, 1 to change, 0 to destroy.
Do you want to perform these actions?
Terraform will perform the actions described above.
Only 'yes' will be accepted to approve.
Enter a value: yes
dbt_cloud_job.cicd: Modifying... [id=225361]
dbt_cloud_job.cicd: Modifications complete after 0s [id=225361]
Apply complete! Resources: 0 added, 1 changed, 0 destroyed.
Thanks for reporting back!
Just be aware that we will soon roll out deferral to environments instead of jobs to all dbt Cloud accounts, and when it is available for your account you will need to replace deferring_job_id = 225359
by deferring_environment_id = <your_prod_env_id>
(I am finalising the updates to the resource)
This is now available in 0.2.8 and docs are updated! https://registry.terraform.io/providers/dbt-labs/dbtcloud/latest/docs/resources/job
That's great, @b-per. When we upgrade to >=0.2.8
, will we need to ask the dbt team to restore the API behavior that was reverted here?
No, 0.2.8
allows you to set the deferral at both the environment level and job level (depending on what your account is set to right now). So you can use >=0.2.8
even if your account still defers at job level.
You will only need to use the deferral to env level when your account will be updated.
We had previously imported a dbt Cloud job into Terraform with the following specifications:
We have made no recent changes to the CICD dbt Cloud job, but we first noticed today that
terraform plan
is detecting the following needed change for thedeferring_job_id
:Note that job ID
225359
has been the stable job ID for our production run for several months now, so it's surprising to see Terraform reporting0
as the job Id. However, upon runningterraform apply
, we get the following error:Given that the configuration provided for
dbt_cloud_job.cicd
agrees with the documented schema, we would expect this plan to be successfully applied (even though it's not clear howdeferring_job_id
was changed to0
)Affected versions:
Terraform v1.4.6 on darwin_arm64
provider registry.terraform.io/dbt-labs/dbtcloud v0.2.7