Skip to content

Conversation

@Divyansh-db
Copy link
Contributor

@Divyansh-db Divyansh-db commented Dec 17, 2025

Changes

Added support for default workspace ID in plugin framework and sdkv2 configure methods. A new defaultWorkspaceID field is a part of DatabricksClient.

Tests

Unit test.

  • make test run locally
  • relevant change in docs/ folder
  • covered with integration tests in internal/acceptance
  • using Go SDK
  • using TF Plugin Framework
  • has entry in NEXT_CHANGELOG.md file

@Divyansh-db Divyansh-db requested review from a team as code owners December 17, 2025 09:11
@Divyansh-db Divyansh-db force-pushed the divyansh-vijayvergia_data/default_workspace_id_support branch from f30f724 to d486bb5 Compare December 17, 2025 09:14
@Divyansh-db Divyansh-db removed request for a team December 17, 2025 09:15
@github-actions
Copy link

If integration tests don't run automatically, an authorized user can run them manually by following the instructions below:

Trigger:
go/deco-tests-run/terraform

Inputs:

  • PR number: 5284
  • Commit SHA: 8dd7a34673f9c90ac3be688e3c8dd753f299e226

Checks will be approved automatically on success.

Copy link
Contributor

@tanmay-db tanmay-db left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some comments. Could you confirm if this works E2E manually on jobs resource. Also we would need to update the provider documentation. See: https://registry.terraform.io/providers/databricks/databricks/latest/docs#argument-reference

Comment on lines +81 to +85
// defaultWorkspaceID is the default workspace ID to use when workspace_id is not
// specified in provider_config at the resource level. This is set from the provider
// configuration and serves as a fallback for unified provider resources.
defaultWorkspaceID string

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: These changes would need to be done upstream as this file is generated.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will add it to the generated file template

Comment on lines +324 to +339
// Add default_workspace_id for unified provider support
ps["default_workspace_id"] = &schema.Schema{
Type: schema.TypeString,
Optional: true,
ValidateFunc: func(val interface{}, key string) (warns []string, errs []error) {
v := val.(string)
if v == "" {
return
}
if !regexp.MustCompile(`^[1-9]\d*$`).MatchString(v) {
errs = append(errs, fmt.Errorf("default_workspace_id must be a positive integer without leading zeros"))
}
return
},
Description: "Default workspace ID to use when workspace_id is not specified in provider_config at the resource level",
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to add this separately or can this be part of ConfigAttributes like it's done for all the other attributes. See line above 316

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ConfigAttributes come from config in Go SDK. default_workspace_id only makes sense in the context of terraform provider so in my opinion, it should not be the part of Go SDK config.

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.

3 participants