Add support for UC secrets - #5861
Conversation
Integration test reportCommit: bb8e450
8 interesting tests: 4 RECOVERED, 4 SKIP
Top 3 slowest tests (at least 2 minutes):
|
| variables: | ||
| secret_value: | ||
| description: "Test secret value" | ||
| default: "initial-secret-value" |
There was a problem hiding this comment.
Should we disallow this pattern? Error if we detect this? Secrets should not be stored in plain text in YAML.
| // Terraform provider implementation: | ||
| // https://github.com/databricks/terraform-provider-databricks/blob/main/catalog/resource_secret.go |
There was a problem hiding this comment.
I think we can drop this comment
| v.SchemaName = resolveSchema(b, v.CatalogName, v.SchemaName) | ||
| v.CatalogName = resolveCatalog(b, v.CatalogName) | ||
| } | ||
| for _, s := range b.Config.Resources.Secrets { |
There was a problem hiding this comment.
Curious (about capture_uc_dependencies in general): is this just a quality of life improvement if customers have their catalog & schema in DABs but don't use the in-bundle reference?
| return nil, err | ||
| } | ||
|
|
||
| // SDK does not support include_value in the GetSecretRequest, so we use the API directly. |
There was a problem hiding this comment.
any reason why? We can (ask to) fix this upstream and switch to the SDK method later
There was a problem hiding this comment.
Not sure why, it's a query param though so I suspect there might not be support for such in SDK yet
| state.Value = state.SecretValue | ||
| response, err := r.client.SecretsUc.CreateSecret(ctx, catalog.CreateSecretRequest{ | ||
| Secret: state.Secret, | ||
| }) | ||
| // Clear the plaintext so it is not written to the state file. | ||
| // Fingerprint already captures whether the value changed. | ||
| state.Value = "" |
There was a problem hiding this comment.
why are we writing state.SecretValue into state.Value, not using it, then clearing state.Value again? is the read of state.Secret derived from Value? if so a comment would help clarify that side-effect.
There was a problem hiding this comment.
ditto below on DoUpdate
There was a problem hiding this comment.
why are we writing state.SecretValue into state.Value, not using it,
We use it below when passing state.Secret, state.Value is practically state.Secret.Value
There was a problem hiding this comment.
a comment like
// temporarily assign `state.Value` so `state.Secret` has access
would help the (future) reader
## Release v1.12.0 ### CLI * `databricks aitools install` now supports Gemini CLI, installing Databricks agent skills into its skills directory. * `databricks aitools install` now supports Pi, installing Databricks agent skills into its skills directory. * A locally built CLI (`go build`, without release flags) now reports the next release version with a `-dev` prerelease, e.g. `1.12.0-dev+abcdef123456`, instead of `0.0.0-dev+abcdef123456`. The old string sorted below every published release even though a local build is newer than the latest release; the new one sorts above the latest release and below the release it will become, matching what goreleaser already produces for snapshot builds. * Added the `databricks environments setup-local` command, which provisions (or updates) a local Python environment matched to a Databricks compute target. It resolves the target to an environment key, fetches the pinned Python version, databricks-connect version, and dependency constraints published for that key, then provisions a matched `.venv` with uv. ### Bundles * Added a `cascade_on_destroy` field to the pipeline resource to control whether destroying a pipeline also deletes its datasets (MVs, STs, Views). When unset, the server default applies; set `cascade_on_destroy: false` to retain the datasets on destroy. Supported with the direct deployment engine ([#5846](#5846)). * Fix `bundle.deployment.lock.force` being ignored. The `--force-lock` flag's default value overwrote the value configured in `databricks.yml`, so setting the field had no effect and a stale deployment lock could only be overridden with the flag. ([#6188](#6188)) * direct: experimental `job_runs` now sends a CLI-managed idempotency token on every run-now, so an SDK retry after a lost response returns the same run. Configured `idempotency_token` values are rejected. * direct: the experimental `job_runs` resource now waits for the triggered run to finish, so other resources can reference its outcome (e.g. `${resources.job_runs.nightly.state.result_state}`). A run that does not succeed fails the deploy, naming the failed task, and is run again on the next deploy. If a deploy is interrupted while waiting, the next one resumes waiting on the same run. * direct: Fixed model serving `telemetry_config` drift and applied planned telemetry updates. Unsupported endpoint types now fail when telemetry is applied; create may still succeed because it drops the field ([#6106](#6106)). * The `cli_version` field in the direct engine's deployment state (`resources.json`) now records the CLI version that last wrote the state. Previously it kept the version of the CLI that first created the state. * Add support for UC secrets resource ([#5861](#5861)) ### Dependency Updates * Bump `github.com/databricks/databricks-sdk-go` from v0.166.0 to v0.169.0. * Bump Terraform provider from v1.124.0 to v1.126.0 ([#6250](#6250)).
Changes
Add support for Unity Catalog (UC) secrets as a first-class DAB resource type under the direct deployment engine.
Notes:
Fixes #3689
Also requires #5896
Example
Tests
Acceptance tests covering create/update/delete, update-value, direct-only enforcement, and the plain-text validation error