Repository navigation
Conversation
Read on dbtcloud_databricks_credential and dbtcloud_spark_credential turned a 404 into an error, so once the credential was deleted outside of Terraform every plan failed. Use helper.HandleResourceNotFound like the other credential resources so the credential is dropped from the state and planned for creation again. Signed-off-by: Lucas Barros <lucasbarros.kam@gmail.com>
lbarrosby
requested a deployment
to
cloud-tests
November 7, 2026 18:38 — with
GitHub Actions
Waiting
This branch is waiting to be deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
If a
dbtcloud_databricks_credentialordbtcloud_spark_credentialis deleted outside of Terraform (UI, API, or with its project), every followingterraform planfails withError reading Databricks credential ... resource-not-found(or the Apache Spark equivalent). The only way out isterraform state rm.Cause
Both
Readmethods turn any error from the client into a diagnostic. The other credential resources (Athena, BigQuery, Postgres, Snowflake, the semantic layer ones, ...) callhelper.HandleResourceNotFoundfirst, so a 404 removes the resource from state and Terraform plans to create it again. These two were missed.Fix
Call
helper.HandleResourceNotFoundin bothReadmethods before returning the error, the same as the other credential resources. Added a changie entry under Fixes.Tests
New
behavior_test.goin each package, following the httptest pattern innotification_setting/behavior_test.go: the server answers the GET with a 404 and the test checks thatReadreturns no error and leaves the state null.Read failed on a 404 instead of removing the resource from state: [{Could not read Databricks credential ID 10:20: resource-not-found: ...}]go testandgo veton both packages pass.golangci-lintreports nothing on the changed files; its existingerrcheckfindings in the acceptance tests are unchanged. I did not run acceptance tests.AI disclosure: written with the help of Claude Code, reviewed and tested by me.