Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions NEXT_CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

### Bug Fixes

* Expand the "workspace-level resource requires a workspace_id" error to list all sources checked (resource `provider_config`, provider `workspace_id`, the configured profile, and the `DATABRICKS_WORKSPACE_ID` environment variable) so users know where to set it ([#5763](https://github.com/databricks/terraform-provider-databricks/pull/5763)).

### Documentation

### Exporter
Expand Down
4 changes: 3 additions & 1 deletion common/client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion common/unified_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,9 @@ func namespaceForceNew(ctx context.Context, d *schema.ResourceDiff, c *Databrick
// or returned zero. Either way, workspace_id is required but missing.
return fmt.Errorf("resource has provider_config.workspace_id = %q in state, "+
"but managing workspace-level resources requires a workspace_id and "+
"none was found in the resource's provider_config block or the provider's workspace_id attribute", oldEffective)
"none was found in any of the following sources (checked in order): the resource's "+
"provider_config block, the provider's workspace_id attribute, the workspace_id in the "+
"configured profile, or the DATABRICKS_WORKSPACE_ID environment variable", oldEffective)
}
newEffective = strconv.FormatInt(resolvedID, 10)
}
Expand Down
2 changes: 1 addition & 1 deletion common/unified_provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ func TestWorkspaceClientUnifiedProvider(t *testing.T) {
},
},
expectError: true,
errorContains: "managing workspace-level resources requires a workspace_id, but none was found in the resource's provider_config block or the provider's workspace_id attribute",
errorContains: "managing workspace-level resources requires a workspace_id, but none was found in any of the following sources (checked in order): the resource's provider_config block, the provider's workspace_id attribute, the workspace_id in the configured profile, or the DATABRICKS_WORKSPACE_ID environment variable",
description: "Account-level provider requires workspace_id to be set",
},
}
Expand Down
Loading