Skip to content

fix: remove connection_id default of 0 in dbtcloud_environment (closes #665)#667

Open
trouze wants to merge 3 commits into
mainfrom
fix/issue-665-connection-id-default
Open

fix: remove connection_id default of 0 in dbtcloud_environment (closes #665)#667
trouze wants to merge 3 commits into
mainfrom
fix/issue-665-connection-id-default

Conversation

@trouze
Copy link
Copy Markdown
Contributor

@trouze trouze commented Apr 9, 2026

Summary

  • Removes Default: int64default.StaticInt64(0) from connection_id in dbtcloud_environment schema
  • Adds connectionIDFromAPI(*int) types.Int64 helper that maps both nil and 0 from the API to types.Int64Null() in Terraform state
  • Fixes Create, Update, and Read methods to use null-safe handling for connection_id

Prevents the "inconsistent result after apply" error that occurs when the dbt Cloud API auto-assigns a non-zero connection ID after create.

Closes #665

🤖 Generated with Claude Code

…#665)

Removes Default: int64default.StaticInt64(0) from the connection_id schema
attribute and replaces scattered nil/0 checks with a connectionIDFromAPI helper
that treats both nil and 0 as null in Terraform state. Fixes the "inconsistent
result after apply" error when the dbt Cloud API auto-assigns a non-zero
connection ID.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@trouze trouze requested a review from a team as a code owner April 9, 2026 19:48
trouze and others added 2 commits April 9, 2026 14:58
After removing the default of 0 from connection_id, the API value
of 0 is now treated as null in state. Update the assertion accordingly.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: remove connection_id default of 0 in dbtcloud_environment to prevent inconsistent result after apply

1 participant