Skip to content

feat(storage_box): support write-only password attributes - #1524

Open
jfilter wants to merge 1 commit into
hetznercloud:mainfrom
jfilter:password-wo-storage-box
Open

jfilter wants to merge 1 commit into
hetznercloud:mainfrom
jfilter:password-wo-storage-box

Conversation

@jfilter

@jfilter jfilter commented Sep 7, 2026

Copy link
Copy Markdown

Closes #1299

Adds password_wo and password_wo_version to hcloud_storage_box and hcloud_storage_box_subaccount, so the Storage Box password never reaches the Terraform state. password becomes optional; exactly one of password and password_wo must be set (ExactlyOneOf), and password_wo requires password_wo_version.

A write-only value is null in plan and state, so it cannot be compared against either. A password reset is therefore triggered by incrementing password_wo_version — the same model the HashiCorp providers use (e.g. aws_db_instance.password_wo_version). Moving an existing configuration from password to password_wo drops the stored password from the state on the next apply.

Write-only arguments need Terraform 1.11 / OpenTofu 1.11 or later; the new acceptance tests skip below that, so the OpenTofu 1.10.x job in the matrix is unaffected.

  • Schema, model and Create/Update paths for both resources
  • Docs, examples and test templates updated (go generate is clean)
  • Acceptance tests: create with password_wo, unchanged plan on same version, reset on incremented version, password/password_wo never written to state

Adds `password_wo` and `password_wo_version` to `hcloud_storage_box` and
`hcloud_storage_box_subaccount`, so the password never reaches the Terraform
state. `password` becomes optional; exactly one of the two must be set.

A write-only value cannot be compared against the state or the API, so the
password is only reset when `password_wo_version` is raised — the model the
HashiCorp providers use. Closes hetznercloud#1299.
@jfilter
jfilter requested a review from a team as a code owner September 7, 2026 21:22
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.

[Feature]: Support write-only password attributes in storage-boxes subaccounts

1 participant