Skip to content

[Feature] Add databricks_secret write-only attributes#5480

Open
ashenm wants to merge 1 commit intodatabricks:mainfrom
ashenm:feature/secret-write-only
Open

[Feature] Add databricks_secret write-only attributes#5480
ashenm wants to merge 1 commit intodatabricks:mainfrom
ashenm:feature/secret-write-only

Conversation

@ashenm
Copy link
Copy Markdown
Contributor

@ashenm ashenm commented Mar 15, 2026

Changes

Add string_value_wo and string_value_wo_version ephemeral attributes to databricks_secret resource allowing write-only secret value population avoiding secret value being written to state

Tests

Tested via unit-tests and also deployed locally using local provider build

  • 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

@ashenm ashenm force-pushed the feature/secret-write-only branch 5 times, most recently from 144575c to b6e51cc Compare March 17, 2026 10:39
@ashenm ashenm marked this pull request as ready for review March 17, 2026 10:39
@ashenm ashenm requested review from a team as code owners March 17, 2026 10:39
@ashenm ashenm requested review from hectorcast-db and removed request for a team March 17, 2026 10:39
@ashenm ashenm force-pushed the feature/secret-write-only branch 2 times, most recently from a1c3cbd to aa340c4 Compare March 23, 2026 02:09
Copy link
Copy Markdown
Contributor

@rauchy rauchy left a comment

Choose a reason for hiding this comment

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

@ashenm Thanks for the PR!

The write-only approach makes sense, but I'm not a fan of changing provider infrastructure (common/resource.go, qa/) for this - that affects every resource in the provider and I'd rather keep the blast radius small.

I think you may avoid all of that by adding an Update handler to the resource. PutSecret is already an upsert so it'd be basically the same as Create. That makes the resource CRUD instead of CRD, which means the ForceNew loop in common/resource.go won't kick in and you don't need to patch it. As a bonus, string_value_wo_version wouldn't need ForceNew either - bumping it would just trigger an update instead of destroy+recreate, which is nicer for users doing secret rotation.

@ashenm ashenm force-pushed the feature/secret-write-only branch 2 times, most recently from 49f846d to 9abdf2e Compare March 25, 2026 07:22
@ashenm
Copy link
Copy Markdown
Contributor Author

ashenm commented Mar 25, 2026

@rauchy yep make sense; updated to CRUD as suggested removing common/ changes. Leaving the qa/ changes as it's required to mimic the actual behaviour of RawConfig for tests

@ashenm ashenm requested a review from rauchy March 25, 2026 07:56
@ashenm ashenm force-pushed the feature/secret-write-only branch 3 times, most recently from ca6c32f to 514e731 Compare March 26, 2026 02:07
@ashenm ashenm force-pushed the feature/secret-write-only branch from 514e731 to a7cb18a Compare March 27, 2026 03:18
@github-actions
Copy link
Copy Markdown

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: 5480
  • Commit SHA: a7cb18ab9672e5951a50dcc38796c5a33c2dc36e

Checks will be approved automatically on success.

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.

2 participants